#22849·vector

Cache kubernetes metadata for deleted pods in source kubernetes_logs

Author: xiaozongyangCreated Apr 10, 2025Updated Sep 29, 2026
Labelssource: kubernetes_logsplatform: kubernetes

A note for the community

  • Please vote on this issue by adding a reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

When a pod is deleted but its log hasn't been consumed completely by the vector agent, we get an error with the message Failed to annotate event with pod metadata.

Since the pod is deleted, its metadata is immutable so that we can cache its metadata. With this cache, we can fix the Failed to annotate event with pod metadata error and make sure the pipeline won't fail if some steps rely on the pod metadata.

Attempted Solutions

  1. add a cache for pod metadata
  2. watch pod events and update the cache if any pod labels changed
  3. keep the pod metadata cache until the log files of the pod are processed completely

Proposal

No response

References

No response

Version

vector 0.45.0 (x86_64-unknown-linux-gnu 063cabb 2025-02-24 14:52:02.810034614)