mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-01 14:47:38 +00:00
app/vmselect/promql: properly handle Prometheus staleness marks in removeCounterResets functions
Prometheus stalenss marks shouldn't be changed in removeCounterResets. Otherwise they will be converted to an ordinary NaN values, which couldn't be removed in dropStaleNaNs() function later. This may result in incorrect calculations for rollup functions. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1526
This commit is contained in:
parent
7d0e64dcc0
commit
af4a306d7b
1 changed files with 3 additions and 3 deletions
|
@ -704,8 +704,6 @@ func getMaxPrevInterval(scrapeInterval int64) int64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
func removeCounterResets(values []float64) {
|
func removeCounterResets(values []float64) {
|
||||||
// There is no need in handling NaNs here, since they are impossible
|
|
||||||
// on values from vmstorage.
|
|
||||||
if len(values) == 0 {
|
if len(values) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -723,7 +721,9 @@ func removeCounterResets(values []float64) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prevValue = v
|
prevValue = v
|
||||||
values[i] = v + correction
|
if !decimal.IsStaleNaN(v) {
|
||||||
|
values[i] = v + correction
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue