From 25997a70f1e81b5756d10286706ccb44e907a5ab Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sun, 15 Aug 2021 12:56:35 +0300 Subject: [PATCH] Revert "app/vmselect/promql: properly handle Prometheus staleness marks in removeCounterResets functions" This reverts commit 94dfcb6747a3b29a11d14e71bea21a2312bb6346. It is better to remove staleness marks (decimal.StaleNaN) before calling rollupConfig.Do, e.g. in preFunc --- app/vmselect/promql/rollup.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/vmselect/promql/rollup.go b/app/vmselect/promql/rollup.go index 95f676475..6c999a93c 100644 --- a/app/vmselect/promql/rollup.go +++ b/app/vmselect/promql/rollup.go @@ -704,6 +704,8 @@ func getMaxPrevInterval(scrapeInterval int64) int64 { } func removeCounterResets(values []float64) { + // There is no need in handling NaNs here, since they are impossible + // on values from vmstorage. if len(values) == 0 { return } @@ -721,9 +723,7 @@ func removeCounterResets(values []float64) { } } prevValue = v - if !decimal.IsStaleNaN(v) { - values[i] = v + correction - } + values[i] = v + correction } }