prometheus/model
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
..
exemplar update links to openmetrics to reference the v1.0.0 release 2024-12-13 21:32:27 +00:00
histogram promql(histograms): Fix counter reset hint handling when aggregating 2025-10-09 19:40:00 +02:00
labels fix: Fix slicelabels corruption when used with proto decoding (#17150) 2025-10-07 12:06:48 +01:00
metadata Revert "feat(storage): add new CombinedAppender interface and compatibility layer" 2025-08-29 08:16:39 +01:00
relabel Replace gopkg.in/yaml.v2 with go.yaml.in/yaml/v2 (#17151) 2025-09-06 13:04:24 +02:00
rulefmt Make metric/label name validation scheme explicit (#16928) 2025-08-18 08:09:00 +00:00
textparse fix: Fix slicelabels corruption when used with proto decoding (#17150) 2025-10-07 12:06:48 +01:00
timestamp Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
value Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00