fix(sources): fallback to file path metadata when pod annotation fails in kubernetes_logs#283
fix(sources): fallback to file path metadata when pod annotation fails in kubernetes_logs#283vparfonov wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
[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 |
…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>
When the
kubernetes_logssource 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 populatingpod_name,pod_namespace,pod_uidandcontainer_namefrom the parsed file path when the pod is not found in the API store, instead of returningNoneand skipping all enrichment.JIRA: https://redhat.atlassian.net/browse/LOG-9584
/cc @Clee2691
/assign @jcantrill