-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add track_timestamps_staleness
to prometheus.scrape
#5921
Comments
cAdvisor puts a timestamp on its metrics; it does this because it sources the data asynchronously so it doesn't want the Prometheus scrape timestamp. Adding a staleness marker just makes the series stop. This is what happens for every other metric that uses Prometheus' timestamp, when it goes away. |
Yes, but unlike non-timestamped metrics, such a target could expose a sample with an old timestamp in a scrape or two. Wouldn't this be a problem if we had already inserted a staleness marker by then? |
No, there is no problem going from {1, 2, stale} to {1, 2, 3, stale}. Or to {1, 2, stale, 3}. But there is a knob to turn it off, in case you run into trouble. My contention is that 99% of the world wants it on, even though Prometheus v2 will default it off for compatibility reasons. |
#5972 was merged, but we will need to raise a new PR for this, since #5972 intentionally did not expose a |
This issue has not had any activity in the past 30 days, so the |
Request
The
track_timestamps_staleness
feature was added to Prometheus recently. To pick it up, we would need to upgrade to Prometheus v2.48 or above.track_timestamps_staleness
isfalse
by default in Prometheus, because it is considered a breaking change. We should consider whether it could be set totrue
in the Agent by default. For example, does setting this tofalse
have any benefits? Are there any implications to alerts which rely on these metrics, and would that be s serious breaking change to users?Also, we need to go into more detail in the docs about what metrics with explicit timestamps are, and what staleness markers are, so that users can make a decision how to configure
track_timestamps_staleness
. This is what the Prometheus docs say fortrack_timestamps_staleness
:I personally didn't even know there could be "metrics that have an explicit timestamps present in scraped data". It is also not clear to me what the implications of adding a staleness marker are.
Use case
Setting
track_timestamps_staleness
totrue
could fix a bug where container metrics linger for 5 minutes after a container dies.The text was updated successfully, but these errors were encountered: