From c20e3a418ba9c95074aa1ee4f1c0c4f68a82008a Mon Sep 17 00:00:00 2001 From: Tal Neiman <33829179+talIguaz@users.noreply.github.com> Date: Wed, 2 Dec 2020 11:49:00 +0200 Subject: [PATCH] ignore step&aggrWindow when tsdb should not do any aggregations (#78) --- storage/tsdb/promtsdb.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/storage/tsdb/promtsdb.go b/storage/tsdb/promtsdb.go index 6396c18929f..d9c91fe9116 100644 --- a/storage/tsdb/promtsdb.go +++ b/storage/tsdb/promtsdb.go @@ -140,13 +140,20 @@ func (promQuery *V3ioPromQuerier) Select(params *storage.SelectParams, oms ...*l promQuery.LastTSDBAggregatedAggr = params.Func } + // In case we can not do aggregations, make sure no step or aggregation window is passed. + step,aggrWindow := params.Step, params.AggregationWindow + if !promQuery.UseV3ioAggregations(){ + step = 0 + aggrWindow = 0 + } + selectParams := &pquerier.SelectParams{Name: name, Functions: function, - Step: params.Step, + Step: step, Filter: filter, From: promQuery.mint, To: promQuery.maxt, - AggregationWindow: params.AggregationWindow} + AggregationWindow: aggrWindow} promQuery.logger.DebugWith("Going to query tsdb", "params", selectParams, "UseAggregates", promQuery.UseAggregates, "UseAggregatesConfig", promQuery.UseAggregatesConfig)