diff --git a/pkg/api/query/v1.go b/pkg/api/query/v1.go index 70f71b0d260..95b8d621ad7 100644 --- a/pkg/api/query/v1.go +++ b/pkg/api/query/v1.go @@ -427,7 +427,6 @@ func (qapi *QueryAPI) labelValues(r *http.Request) (interface{}, []error, *api.A if err != nil { return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err} } - // Prometheus doesn't check this, do we need to? if end.Before(start) { err := errors.New("end timestamp must not be before start time") return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err} @@ -481,6 +480,10 @@ func (qapi *QueryAPI) series(r *http.Request) (interface{}, []error, *api.ApiErr if err != nil { return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err} } + if end.Before(start) { + err := errors.New("end timestamp must not be before start time") + return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err} + } var matcherSets [][]*labels.Matcher for _, s := range r.Form["match[]"] {