-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Make prometheus serializer update timestamps and expiration time as new data arrives #9139
Make prometheus serializer update timestamps and expiration time as new data arrives #9139
Conversation
This does potentially **never** expire old data. If an old quantile or bucket is never updated it will never be expired if new data comes in. Potentially requiring a restart of telegraf to get rid of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤝 ✅ CLA has been signed. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to me for expiration to be relative to to the last time a histogram or summary is gathered instead of the first time. Thanks @jakemcc for adding comprehensive tests for this.
We've been running with a fork that includes these changes since a little before I submitted this PR. It has been working well for us and, as expected, has resolved the gaps mentioned in the referenced issues. |
Looks like new artifacts were built from this PR. Get them here!Artifact URLs |
resolves #8170
Replaces #8257
#8257 partially implements a fix for #8170 but this PR expands it to also resolve the expiration issue to the Summary type.
It also updates both the Histogram and Summary
timestampMs
field when new data arrives for a particular Histogram or Summary. I talk about this problem in this comment on #8170. Below expands on it.If you have configured
[[outputs.prometheus_client]]
toexport_timestamps = true
then without the updating oftimestampMs
on new data coming in you end up in a situation like below.Say you are pushing prometheus data to telegraf. The first batch might look something like below with a timestamp of
1617722541063
About 10 seconds later, you publish an update to telegraf.
If telegraf is then scrapped by prometheus and
export_timestamp = true
, the initial first received timestamp is exported instead of the correct second timestamp. UpdatingtimestampMs
as new data comes in resolves this issue.