loki: alerting: simplified config (#42147)

* loki: alerting: simplified config

* adjusted config handling
This commit is contained in:
Gábor Farkas 2021-11-24 11:52:33 +01:00 committed by GitHub
parent eaf46600c4
commit fe84454bb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {