Skip to content
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

Histogram metrics emitted for api_request_duration_seconds are not correct #441

Closed
franklywatson opened this issue Aug 15, 2024 · 0 comments · Fixed by #442
Closed

Histogram metrics emitted for api_request_duration_seconds are not correct #441

franklywatson opened this issue Aug 15, 2024 · 0 comments · Fixed by #442
Labels
Bug Something isn't working Feedback

Comments

@franklywatson
Copy link
Contributor

franklywatson commented Aug 15, 2024

Problem

There are one or more things a bit off with the way the api_request_duration metric summary is being calculated/handled which results in metric histogram values that block creation of monitoring graphs for this metric.

The first issue is there is possibly a rounding issue with the metric value calculation. When you look at the Prometheus.DefBuckets definition which we apply to the metric we would expect a metric datapoint with a value of 0.052 seconds and the le tag for that metric datapoint to be 0.01. In the first screenshot the metrics have various smaller le tags but all of them have a 0 value, suggesting that values <1 are being rounded to 0.

The next issue I haven't quite figured out but relates to the second screenshot. The two metrics shown there have values of 39 and 18, meaning that they should have been bucketed into the 100 le tag. Why they are showing as Infinity isn't clear to me. The docs state that Infinity is reserved for values outside the specified bucket ranges (so should apply only to values >100).. however for some reason that's not happening.

Examples

Screenshot 2024-08-15 at 1 19 55 PM
Screenshot 2024-08-15 at 1 28 07 PM
metrics.json

Acceptance Criteria

  • Metric floating point values should be emitted verbatim without rounding
  • Metric values correspond to the correct bucket they belong to

Context

Reference: https://medium.com/mercari-engineering/have-you-been-using-histogram-metrics-correctly-730c9547a7a9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Feedback
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant