From 70ef27715c2b94a1b9a81d83c2031dd2eb8f43c6 Mon Sep 17 00:00:00 2001 From: Aleksey Sin Date: Wed, 15 Jan 2020 12:15:33 +0300 Subject: [PATCH] Support downsampling for /series. Signed-off-by: Aleksey Sin --- pkg/query/api/v1.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/query/api/v1.go b/pkg/query/api/v1.go index 0fb1b24b443..28bf99b1bf9 100644 --- a/pkg/query/api/v1.go +++ b/pkg/query/api/v1.go @@ -502,8 +502,11 @@ func (api *API) series(r *http.Request) (interface{}, []error, *ApiError) { return nil, nil, apiErr } - // TODO(bwplotka): Support downsampling? - q, err := api.queryableCreate(enableDedup, replicaLabels, 0, enablePartialResponse, true). + maxSourceResolution, apiErr := api.parseDownsamplingParamMillis(r, api.defaultInstantQueryMaxSourceResolution) + if apiErr != nil { + return nil, nil, apiErr + } + q, err := api.queryableCreate(enableDedup, replicaLabels, maxSourceResolution, enablePartialResponse, true). Querier(r.Context(), timestamp.FromTime(start), timestamp.FromTime(end)) if err != nil { return nil, nil, &ApiError{errorExec, err}