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.

…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>
@jcantrill

Copy link
Copy Markdown
Member

/approve

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcantrill, vparfonov

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

The pull request process is described 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

@openshift-ci openshift-ci Bot added the approved label Aug 6, 2026
@jcantrill

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Aug 6, 2026
@vparfonov

Copy link
Copy Markdown
Author

/retest-required

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

@vparfonov: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/clo-functional 9878988 link true /test clo-functional
ci/prow/cluster-logging-operator-e2e 9878988 link true /test cluster-logging-operator-e2e

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@vparfonov

Copy link
Copy Markdown
Author

/retest-required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants