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 {