-
Notifications
You must be signed in to change notification settings - Fork 832
Closed
Description
Time ranges for range queries are validated against a per-tenant limit.
Lines 285 to 289 in e0663b7
startTime := model.Time(sp.Start) | |
endTime := model.Time(sp.End) | |
if maxQueryLength := q.limits.MaxQueryLength(userID); maxQueryLength > 0 && endTime.Sub(startTime) > maxQueryLength { | |
return storage.ErrSeriesSet(fmt.Errorf(validation.ErrQueryTooLong, endTime.Sub(startTime), maxQueryLength)) | |
} |
Within Prometheus API, the query_range
endpoint does all of its validation upfront - meaning that incorrect input errors (400s) are validated before the query is ran.
As it is, Cortex will return a 500 for the validation of this limit which seems incorrect. Any thoughts?
I'm not sure upstream will accept changes to encapsulate custom validation as part of the API, the other options is to copy the validation code of the code of this particular endpoint which seems unideal.
An example of the error:
{
"status": "error",
"errorType": "internal",
"error": "expanding series: the query time range exceeds the limit (query length: 4414h5m0s, limit: 768h0m0s)"
}
Metadata
Metadata
Assignees
Labels
No labels