From 6ab90425c4bfd1f9041fa28541835e9af72f92fe Mon Sep 17 00:00:00 2001 From: Pranay Kanwar Date: Mon, 6 Mar 2017 20:49:37 +0530 Subject: [PATCH] Pass dropcounter rate option if no max counter and no reset value or reset value as 0 is specified (#7743) --- pkg/tsdb/opentsdb/opentsdb.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/tsdb/opentsdb/opentsdb.go b/pkg/tsdb/opentsdb/opentsdb.go index 684f48bfc59..c0ba6603b20 100644 --- a/pkg/tsdb/opentsdb/opentsdb.go +++ b/pkg/tsdb/opentsdb/opentsdb.go @@ -190,6 +190,10 @@ func (e *OpenTsdbExecutor) buildMetric(query *tsdb.Query) map[string]interface{} rateOptions["resetValue"] = resetValue.MustFloat64() } + if !counterMaxCheck && (!resetValueCheck || resetValue.MustFloat64() == 0) { + rateOptions["dropcounter"] = true + } + metric["rateOptions"] = rateOptions }