Skip to content

fix(sources): fallback to file path metadata when pod annotation fails in kubernetes_logs#283

Open
vparfonov wants to merge 1 commit into
ViaQ:v0.54.0-rhfrom
vparfonov:log-9584-rh
Open

fix(sources): fallback to file path metadata when pod annotation fails in kubernetes_logs#283
vparfonov wants to merge 1 commit into
ViaQ:v0.54.0-rhfrom
vparfonov:log-9584-rh

Conversation

@vparfonov

Copy link
Copy Markdown

When the kubernetes_logs source fails to annotate an event with pod metadata (e.g. pod already deleted before Vector could look it up), the event is sent downstream with no kubernetes metadata at all.

This causes issues in downstream transforms that expect fields like namespace_name to be present.

The file path (/var/log/pods/<ns>_<pod>_<uid>/<container>/<n>.log) always contains the basic metadata. This change makes the annotator fall back to populating pod_name, pod_namespace, pod_uid and container_name from the parsed file path when the pod is not found in the API store, instead of returning None and skipping all enrichment.

JIRA: https://redhat.atlassian.net/browse/LOG-9584

/cc @Clee2691
/assign @jcantrill

@openshift-ci openshift-ci Bot requested a review from Clee2691 July 14, 2026 11:33
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 899fc595-d128-4d54-9d82-1561f3135ad5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vparfonov
Once this PR has been reviewed and has the lgtm label, please ask for approval from jcantrill. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

…s in kubernetes_logs

When the kubernetes_logs source fails to annotate an event with pod
metadata (e.g. pod already deleted before Vector could look it up),
the event is sent downstream with no kubernetes metadata at all.

This causes issues in downstream transforms that expect fields like
namespace_name to be present.

The file path (/var/log/pods/<ns>_<pod>_<uid>/<container>/<n>.log)
always contains the basic metadata. This change makes the annotator
fall back to populating pod_name, pod_namespace, pod_uid, and
container_name from the parsed file path when the pod is not found
in the API store, instead of returning None and skipping all
enrichment.

Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants