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
This commit is contained in:
Aliaksandr Valialkin 2021-08-15 12:56:35 +03:00
parent 73d7b568da
commit 25997a70f1

View file

@ -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
}
}