diff --git a/pkg/query/api/v1.go b/pkg/query/api/v1.go index 7f78587811..0152d18126 100644 --- a/pkg/query/api/v1.go +++ b/pkg/query/api/v1.go @@ -503,7 +503,8 @@ func (api *API) series(r *http.Request) (interface{}, []error, *ApiError) { } // TODO(bwplotka): Support downsampling? - q, err := api.queryableCreate(enableDedup, replicaLabels, 0, enablePartialResponse).Querier(r.Context(), timestamp.FromTime(start), timestamp.FromTime(end)) + q, err := api.queryableCreate(enableDedup, replicaLabels, 0, enablePartialResponse). + Querier(r.Context(), timestamp.FromTime(start), timestamp.FromTime(end)) if err != nil { return nil, nil, &ApiError{errorExec, err} } @@ -515,7 +516,7 @@ func (api *API) series(r *http.Request) (interface{}, []error, *ApiError) { sets []storage.SeriesSet ) for _, mset := range matcherSets { - s, warns, err := q.Select(&storage.SelectParams{}, mset...) + s, warns, err := q.Select(nil, mset...) if err != nil { return nil, nil, &ApiError{errorExec, err} } diff --git a/pkg/query/querier.go b/pkg/query/querier.go index dac3feab4b..4263d81a36 100644 --- a/pkg/query/querier.go +++ b/pkg/query/querier.go @@ -169,12 +169,18 @@ func (q *querier) Select(params *storage.SelectParams, ms ...*labels.Matcher) (s return nil, nil, errors.Wrap(err, "convert matchers") } + if params == nil { + params = &storage.SelectParams{ + Start: q.mint, + End: q.maxt, + } + } queryAggrs, resAggr := aggrsFromFunc(params.Func) resp := &seriesServer{ctx: ctx} if err := q.proxy.Series(&storepb.SeriesRequest{ - MinTime: q.mint, - MaxTime: q.maxt, + MinTime: params.Start, + MaxTime: params.End, Matchers: sms, MaxResolutionWindow: q.maxResolutionMillis, Aggregates: queryAggrs,