From de24dca9adcfb88b10fca7c29f1997808ec928fc Mon Sep 17 00:00:00 2001 From: Paul Grave Date: Thu, 30 Dec 2021 10:21:34 +0000 Subject: [PATCH] fixed: issue #5011 that impacted exemplars appearing in Grafana Signed-off-by: Paul Grave --- pkg/api/query/v1.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/api/query/v1.go b/pkg/api/query/v1.go index 53986cfce8..f5365a8f39 100644 --- a/pkg/api/query/v1.go +++ b/pkg/api/query/v1.go @@ -28,7 +28,6 @@ import ( "strings" "time" - cortexutil "github.com/cortexproject/cortex/pkg/util" "github.com/go-kit/log" "github.com/opentracing/opentracing-go" "github.com/pkg/errors" @@ -821,18 +820,18 @@ func NewExemplarsHandler(client exemplars.UnaryClient, enablePartialResponse boo err error ) - start, err := cortexutil.ParseTime(r.FormValue("start")) + start, err := parseTimeParam(r, "start", infMinTime) if err != nil { return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err} } - end, err := cortexutil.ParseTime(r.FormValue("end")) + end, err := parseTimeParam(r, "end", infMaxTime) if err != nil { return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err} } req := &exemplarspb.ExemplarsRequest{ - Start: start, - End: end, + Start: timestamp.FromTime(start), + End: timestamp.FromTime(end), Query: r.FormValue("query"), PartialResponseStrategy: ps, }