filter_kubernetes: Document metadata cache and freshness#2611
Conversation
Explain how the Kubernetes filter caches pod metadata in an in-memory table keyed by namespace and pod name, and why long-lived pods with a stable name (such as StatefulSet members) keep serving the labels and annotations captured when the entry was first cached until the pod restarts or the entry is evicted. Document how to tune freshness with kube_meta_cache_ttl, kube_meta_namespace_cache_ttl and cache_use_docker_id, including the request-load tradeoffs, and cross-link the related troubleshooting note. Signed-off-by: Abdessamade Abarchihi <135852701+Abdessamade03@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughDocumentation update to the Kubernetes filter page adding a new "Metadata cache and freshness" section describing pod metadata caching behavior, TTL configuration options, and staleness scenarios, plus an extension to the troubleshooting section referencing this new content. ChangesMetadata Cache Documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Add a concrete StatefulSet example to the metadata cache and freshness section, showing how an in-place label change is reflected with and without kube_meta_cache_ttl, and noting cache_use_docker_id for the Pod recreation case. Addresses review feedback on the docs PR. Signed-off-by: Abdessamade Abarchihi <135852701+Abdessamade03@users.noreply.github.com>
eschabell
left a comment
There was a problem hiding this comment.
@Abdessamade03 verified this against the current code base, merging!
What
Adds a "Metadata cache and freshness" section to the Kubernetes filter documentation, explaining:
namespace+pod_name).kube_meta_cache_ttl=0means entries have no time-based expiry (random eviction only at capacity), so long-lived pods with a stable name (for example,StatefulSetmembers) keep serving the labels and annotations captured when the entry was first cached, until the pod restarts or the entry is evicted.kube_meta_cache_ttl,kube_meta_namespace_cache_ttl, andcache_use_docker_id, including the request-load tradeoffs.Also cross-links the "You can't see new objects getting metadata" troubleshooting note to the new section.
Why
Documentation half of the improvement discussed in fluent/fluent-bit#11961, where the current (by-design) caching behavior surprised a user running StatefulSets. @patrick-stephens suggested documenting the behavior and caveats as an immediately-useful first step; an opt-in implementation improvement will follow separately.
Notes
pipeline/filters/kubernetes.md..markdownlint.json(MD013 disabled, atx headings,_emphasis).Summary by CodeRabbit