Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Ensure kubernetes caches don't expire if they are being read #10946
Some metrics in metricbeat kubernetes module are cached during a time,
Also, use slashes instead of dashes to generate unique container uids.
I have been testing this with master and 6.6.1 and it seems to work.
As caches are now, #10658 can still happen if period of container metricset is greater than 120 seconds, fixing this would require to further refactor the global cache. I leave this for future improvements (#10965) as I don't think many people will have these periods. A quick "fix" would be to increase the default timeout.
referenced this pull request
Feb 27, 2019
It only quickly peaked at the cache, but it looks similar to libbeat/common/cache.go (godoc) which expires elements based on their last access time, has a goroutine to periodically do cleanup, and allows injecting a clock for testing (but injecting the clock isn't exported so you'd need to expose this).