LOG-8386: Initialize custom Loki label keys in VRL remap#3248
LOG-8386: Initialize custom Loki label keys in VRL remap#3248vparfonov wants to merge 1 commit intoopenshift:release-6.4from
Conversation
Review Summary by QodoInitialize custom Loki label keys in VRL remap transform
WalkthroughsDescription• Initialize custom Loki label keys in VRL remap transform • Add remapLabelKeys() function to include container metadata and custom fields • Prevent missing field errors when users specify custom labelKeys in Loki output • Update remap labels to use dynamic label key initialization Diagramflowchart LR
A["User Custom LabelKeys"] --> B["remapLabelKeys Function"]
C["Container Metadata Labels"] --> B
B --> D["VRL Remap Transform"]
D --> E["Loki Output with Initialized Fields"]
File Changes1. internal/generator/vector/output/loki/loki.go
|
Code Review by Qodo
|
|
@vparfonov: This pull request references LOG-8386 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vparfonov The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
When users specify custom labelKeys in Loki output configuration, they were not being properly initialized in the VRL remap transform, causing empty strings in Loki. Fix two issues: Add remapLabelKeys() that returns both the required container metadata fields (kubernetes.namespace_name, kubernetes.pod_name, kubernetes.container_name) plus any user-specified custom labelKeys that are read directly from log records. Labels sanitizes by replacing `/` and `.` with `_` and quotes it. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
/retest |
|
@vparfonov: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
When users specify custom labelKeys in Loki output, they were not initialized in the VRL remap transform, causing empty strings in Loki. Add remapLabelKeys() to initialize both container metadata fields and custom user-specified fields that are read directly from log records.
/cc @cahartma @Clee2691
/assign @jcantrill
Links