prometheus/promql
Julien Pivotto 55193c3058 promql: fix smoothed interpolation across counter resets
Fix incorrect interpolation when counter resets occur in smoothed range
selector evaluation. Previously, the asymmetric handling of counter
resets (y1=0 on left edge, y2+=y1 on right edge) produced wrong values.

Now uniformly set y1=0 when a counter reset is detected, correctly
modeling the counter as starting from 0 post-reset.

This fixes rate calculations across counter resets. For example,
rate(metric[10s] smoothed) where metric goes from 100 to 10 (a reset)
now correctly computes 0.666... by treating the counter as resetting
to 0 rather than producing inflated values from the old behavior.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-02-02 11:54:35 +01:00
..
fuzz-data textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
parser Merge pull request #17626 from aviralgarg05/fix-promqltest-counter-reset-hint-comparison 2026-01-22 15:03:20 +01:00
promqltest promql: fix smoothed interpolation across counter resets 2026-02-02 11:54:35 +01:00
bench_test.go tests(teststorage): Close Storage in the helper (#17902) 2026-01-23 08:41:35 +00:00
durations.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
durations_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
engine.go promql: fix smoothed interpolation across counter resets 2026-02-02 11:54:35 +01:00
engine_internal_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
engine_test.go tests(teststorage): Close Storage in the helper (#17902) 2026-01-23 08:41:35 +00:00
functions.go promql: fix smoothed interpolation across counter resets 2026-02-02 11:54:35 +01:00
functions_internal_test.go promql: fix smoothed interpolation across counter resets 2026-02-02 11:54:35 +01:00
functions_test.go tests(teststorage): Close Storage in the helper (#17902) 2026-01-23 08:41:35 +00:00
fuzz.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
fuzz_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
histogram_stats_iterator.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
histogram_stats_iterator_test.go feat(tsdb): new AppenderV2 and AtST interface for chunks 2026-01-14 13:15:09 +01:00
info.go promql: info function: fix series without identifying labels not being returned (#17898) 2026-01-20 16:53:27 +01:00
promql_test.go tests(teststorage): Close Storage in the helper (#17902) 2026-01-23 08:41:35 +00:00
quantile.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
quantile_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
query_logger.go fix(promql): prevent panic in trimStringByBytes on invalid UTF-8 2026-01-24 16:06:42 +01:00
query_logger_test.go fix(promql): prevent panic in trimStringByBytes on invalid UTF-8 2026-01-24 16:06:42 +01:00
value.go feat(tsdb): new AppenderV2 and AtST interface for chunks 2026-01-14 13:15:09 +01:00
value_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00