-
Notifications
You must be signed in to change notification settings - Fork 720
Change scrape_duration_seconds to gauge #90
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
Conversation
So, the bucket gets configured by the user and not by us? Reading up on https://prometheus.io/docs/practices/histograms/ |
This should be a gauge, which contains the information for that scrape. This was fixed a while back on the node exporter, I'm guessing this was copied from before then. |
… split out collector_success
f57ebfe
to
56a3ca2
Compare
@brian-brazil Ah, that makes sense. Yes, the summary is probably from the initial commit, more or less. |
exporter.go
Outdated
|
||
if err != nil { | ||
log.Errorf("ERROR: %s collector failed after %fs: %s", name, duration.Seconds(), err) | ||
result = "error" | ||
scrapeSuccess.WithLabelValues(name).Set(0) |
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.
This should use ConstMetrics, so there's no interference from any scrapes happening at the same time
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.
Thanks. Fixed!
49c11ee
to
9ba762e
Compare
👍 |
LGTM! |
Currently the
scrape_duration_seconds
metric is a summary. When trying to reason about #89, it is hard to look back in time to see if others have this problem as well, since we do not have the buckets. I see no real benefit in using a summary here, and think we should be using a histogram instead.Probably we should be setting the
Buckets
option as well, rather than using the defaults. My lowest 0.5 quantile with the current summary is ~0.04s, so I would make an initial guess that something like[0.01, 0.015, 0.03, 0.1, 0.15, 0.3, 1.0, 3.0, Inf]
would capture the interesting ranges with acceptable precision?