Loki: Improve error message when step too low (#9641)

**What this PR does / why we need it**:

In https://github.com/grafana/grafana/pull/69648 we are in Grafana
introducing a step editor in Loki. Unfortunately, the error message when
user sets too low step parameter is hard to understand, so I am
proposing following change to make it more understandable and
actionable.

Let me know what do you think.

---------

Co-authored-by: J Stickler <julie.stickler@grafana.com>
pull/9645/head^2
Ivana Huckova 3 years ago committed by GitHub
parent 415a997fb9
commit eb7dae4583
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/loghttp/query.go
  2. 2
      pkg/querier/queryrange/queryrangebase/query_range.go

@ -18,7 +18,7 @@ import (
var (
errEndBeforeStart = errors.New("end timestamp must not be before or equal to start time")
errNegativeStep = errors.New("zero or negative query resolution step widths are not accepted. Try a positive integer")
errStepTooSmall = errors.New("exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)")
errStepTooSmall = errors.New("exceeded maximum resolution of 11,000 points per time series. Try increasing the value of the step parameter")
errNegativeInterval = errors.New("interval must be >= 0")
)

@ -38,7 +38,7 @@ var (
}.Froze()
errEndBeforeStart = httpgrpc.Errorf(http.StatusBadRequest, "end timestamp must not be before start time")
errNegativeStep = httpgrpc.Errorf(http.StatusBadRequest, "zero or negative query resolution step widths are not accepted. Try a positive integer")
errStepTooSmall = httpgrpc.Errorf(http.StatusBadRequest, "exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)")
errStepTooSmall = httpgrpc.Errorf(http.StatusBadRequest, "exceeded maximum resolution of 11,000 points per time series. Try increasing the value of the step parameter")
// PrometheusCodec is a codec to encode and decode Prometheus query range requests and responses.
PrometheusCodec Codec = &prometheusCodec{}

Loading…
Cancel
Save