Skip to content

Commit

Permalink
Loki: Improve error message when step too low (#9641)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:

In grafana/grafana#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>
  • Loading branch information
ivanahuckova and JStickler committed Jun 7, 2023
1 parent 415a997 commit eb7dae4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/loghttp/query.go
Expand Up @@ -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")
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/queryrange/queryrangebase/query_range.go
Expand Up @@ -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{}
Expand Down

0 comments on commit eb7dae4

Please sign in to comment.