-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Description
Proposal
In short: The histogramRate function can be applied to gauge histograms and to counter histograms. Ideally, the isCounter argument is true if applied to counter histograms, and it is false if applied to gauge histograms. Otherwise, we should issue a warning via the new annotation system.
See relevant TODOs in the code:
prometheus/promql/functions.go
Line 199 in 756202a
// TODO(trevorwhitney): Check if isCounter is consistent with curr.CounterResetHint. prometheus/model/histogram/float_histogram.go
Line 473 in 756202a
// (and we plan to return a warning about it to the user).
The broad plan would be to issue the warning in the following two cases:
isCounterisfalsebut the first or the last histogram in the range is not a gauge histogram.isCounteristruebut at least one histogram in the range is a gauge histogram.
The good thing here is that we know precisely if a histogram is a gauge histogram or a counter histogram. It's not just a naming convention we have to rely on like for float samples.