-
Notifications
You must be signed in to change notification settings - Fork 963
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GaugeHistogram for Prometheus LongTaskTimer
The Prometheus registry used "classic" cumulative Prometheus Histogram for LongTaskTimer. This was conceptually wrong since _count, _sum, and _bucket are counters (monotonic) in case of "classic" Prometheus Histogram but since LongTaskTimer measures the currently active tasks, these values can increase or decrease so a Prometheus GaugeHistogram is a better fit for it since there _gcount, _gsum, and _bucket are gauges (non-monotonic). See the OpenMetrics specs for more details: https://github.com/OpenObservability/OpenMetrics/blob/1386544931307dff279688f332890c31b6c5de36/specification/OpenMetrics.md#gaugehistogram This also means that the suffix of the time series change: - From _count to _gcount - From _sum to _gsum So the scrape output of a LongTaskTimer (test.ltt) could look like this: # HELP test_ltt_seconds # TYPE test_ltt_seconds histogram test_ltt_seconds_bucket{le="120.0"} 1 [...] test_ltt_seconds_bucket{le="7200.0"} 1 test_ltt_seconds_bucket{le="+Inf"} 1 # HELP test_ltt_seconds_gcount # TYPE test_ltt_seconds_gcount gauge test_ltt_seconds_gcount 1 # HELP test_ltt_seconds_gsum # TYPE test_ltt_seconds_gsum gauge test_ltt_seconds_gsum 10.0 # HELP test_ltt_seconds_max # TYPE test_ltt_seconds_max gauge test_ltt_seconds_max 10.0 Closes gh-4988
- Loading branch information
1 parent
b2d8dc7
commit d7b9d24
Showing
2 changed files
with
235 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters