prometheus/model/histogram
beorn7 51e0982c91
Some checks failed
CI / Go tests (push) Has been cancelled
CI / More Go tests (push) Has been cancelled
CI / Go tests with previous Go version (push) Has been cancelled
CI / UI tests (push) Has been cancelled
CI / Go tests on Windows (push) Has been cancelled
CI / Mixins tests (push) Has been cancelled
CI / Build Prometheus for common architectures (push) Has been cancelled
CI / Build Prometheus for all architectures (push) Has been cancelled
CI / Check generated parser (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
CI / fuzzing (push) Has been cancelled
CI / codeql (push) Has been cancelled
CI / Report status of build Prometheus for all architectures (push) Has been cancelled
CI / Publish main branch artifacts (push) Has been cancelled
CI / Publish release artefacts (push) Has been cancelled
CI / Publish UI on npm Registry (push) Has been cancelled
promql(histograms): Fix counter reset hint handling when aggregating
Fixes #17308.

As explained adding the warn-annotation about conflicting counter
reset hints doesn't happen consistently. Furthermore, because of
incremental mean calculation being used so far (which includes
subtraction), avg calculation always created gauge histograms.

The fix is to make Sub behave like Add WRT counter reset handling, and
then set the result of a subtraction to gauge explicitly in actual
PromQL subtraction (rather than using Sub for something else, like
incremental mean calculation). Also, track the presence of a
CounterReset hint and a NotCounterReset hint separately for the
entirety of aggregated histograms and create the warn-annotation based
on that.

As a minor fix, this commit also consistently creates the warn
annotation in aggregation to be about "aggregation" rather than
"subtraction" or "addition", because the latter are just internal
operations within the aggregation, which is not of interest for the
user.

Signed-off-by: beorn7 <beorn@grafana.com>
2025-10-09 19:40:00 +02:00
..
float_histogram.go promql(histograms): Fix counter reset hint handling when aggregating 2025-10-09 19:40:00 +02:00
float_histogram_test.go promql(histograms): Fix counter reset hint handling when aggregating 2025-10-09 19:40:00 +02:00
generic.go Merge pull request #17284 from linasm/custom-bucket-bounds-match-fn 2025-10-07 15:38:59 +02:00
generic_test.go [NHCB] Separate CustomBucketBoundsMatch from floatBucketsMatch 2025-10-05 22:38:07 +03:00
histogram.go [NHCB] Separate CustomBucketBoundsMatch from floatBucketsMatch 2025-10-05 22:38:07 +03:00
histogram_test.go NHCB: Reject custom bucket bounds with NaN value 2025-10-06 16:37:28 +03:00
test_utils.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00