From fe84454bb0857cd2e01beee3e0abe840d0c53632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Farkas?= Date: Wed, 24 Nov 2021 11:52:33 +0100 Subject: [PATCH] loki: alerting: simplified config (#42147) * loki: alerting: simplified config * adjusted config handling --- pkg/tsdb/loki/loki.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/tsdb/loki/loki.go b/pkg/tsdb/loki/loki.go index 1737a040d3f..de933cd2d0f 100644 --- a/pkg/tsdb/loki/loki.go +++ b/pkg/tsdb/loki/loki.go @@ -141,10 +141,12 @@ func (s *Service) QueryData(ctx context.Context, req *backend.QueryDataRequest) span.SetTag("stop_unixnano", query.End.UnixNano()) defer span.Finish() - //Currently hard coded as not used - applies to log queries - limit := 1000 - //Currently hard coded as not used - applies to queries which produce a stream response - interval := time.Second * 1 + // `limit` only applies to log-producing queries, and we + // currently only support metric queries, so this can be set to any value. + limit := 1 + + // we do not use `interval`, so we set it to zero + interval := time.Duration(0) value, err := client.QueryRange(query.Expr, limit, query.Start, query.End, logproto.BACKWARD, query.Step, interval, false) if err != nil {