prometheus/promql
aviralgarg05 e894d7a271 promqltest: Add optional counter reset hint comparison for native histograms
This commit implements counter reset hint comparison in the promqltest
framework to address issue #17615. Previously, while test definitions
could specify a counter_reset_hint in expected native histogram results,
the framework did not actually compare this hint between expected and
actual results.

The implementation adds optional comparison logic to the
compareNativeHistogram function:
- If the expected histogram has UnknownCounterReset (the default),
  the hint is not compared (meaning "don't care")
- If the expected histogram explicitly specifies CounterReset,
  NotCounterReset, or GaugeType, it is verified against the actual
  histogram's hint

This allows tests to verify that PromQL functions correctly set or
preserve counter reset hints while maintaining backward compatibility
with existing tests that don't specify explicit hints.

Fixes #17615

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2025-11-30 13:34:19 +05:30
..
fuzz-data textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
parser Update golangci-lint (#17478) 2025-11-05 13:47:34 +01:00
promqltest promqltest: Add optional counter reset hint comparison for native histograms 2025-11-30 13:34:19 +05:30
bench_test.go Update modernize (#17471) 2025-11-04 05:13:49 +00:00
durations.go chore(promql): improve doc string in promql/durations.go (#16863) 2025-07-11 12:07:54 +02:00
durations_test.go Add step(), min(a,b) and max(a,b) in promql duration expressions 2025-07-02 11:17:17 +02:00
engine.go instrumentation: add native histograms to complement high-traffic summaries (#17374) 2025-11-27 18:45:35 +01:00
engine_internal_test.go promql (histograms): reconcile mismatched NHCB bounds (#17278) 2025-10-18 01:03:52 +02:00
engine_test.go Update modernize (#17471) 2025-11-04 05:13:49 +00:00
functions.go promql: Ensure that rate/increase/delta of histograms results in a gauge histogram. (#17608) 2025-11-26 18:18:01 +01:00
functions_internal_test.go promql: Ensure that rate/increase/delta of histograms results in a gauge histogram. (#17608) 2025-11-26 18:18:01 +01:00
functions_test.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
fuzz.go refactor(textparse): Introduce Variadic options in textParse.New (#17155) 2025-09-11 10:49:42 +01:00
fuzz_test.go fix: use "ErrorContains" or "EqualError" instead of "Contains(t, err.Error()" and "Equal(t, err.Error()" (#15094) 2024-10-06 16:35:29 +00:00
histogram_stats_iterator.go promql: Make HistogramStatsIterator.AtFloatHistogram idempotent 2025-09-09 14:59:15 +02:00
histogram_stats_iterator_test.go promql: Make HistogramStatsIterator.AtFloatHistogram idempotent 2025-09-09 14:59:15 +02:00
info.go [PERF] PromQL: eliminate string-keyed maps in binary vector matching (#17131) 2025-11-12 10:43:05 +00:00
promql_test.go Add anchored and smoothed to vector selectors. (#16457) 2025-09-25 11:34:59 +02:00
quantile.go fix(promql): histogram_quantile and histogram_fraction NaN observed in native histogram (#16724) 2025-06-25 13:37:43 +02:00
quantile_test.go Export quantile functions (#15190) 2024-11-27 13:20:23 +01:00
query_logger.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
query_logger_test.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
value.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
value_test.go test: move most PromQL tests into separate test package 2024-05-08 16:28:56 +01:00