From 414259f47bc0335f57fbb1dca13714a21fb2f289 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sat, 23 Nov 2019 14:19:08 +0200 Subject: [PATCH] app/vmselect/promql: do not take into account buckets with negative counters in `prometheus_buckets` --- app/vmselect/promql/transform.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/vmselect/promql/transform.go b/app/vmselect/promql/transform.go index 03a55a9e4a..ac00a57d45 100644 --- a/app/vmselect/promql/transform.go +++ b/app/vmselect/promql/transform.go @@ -362,7 +362,7 @@ func vmrangeBucketsToLE(tss []*timeseries) []*timeseries { for _, xs := range xss { ts := xs.ts v := ts.Values[i] - if !math.IsNaN(v) { + if !math.IsNaN(v) && v > 0 { count += v } ts.Values[i] = count