From 7ff565a91e58e9c00792c424f3cbb3208b06eeb9 Mon Sep 17 00:00:00 2001 From: Thomas Jackson Date: Tue, 21 Mar 2023 11:58:57 -0700 Subject: [PATCH] Only set start/end if time is not Zero This is an updated PR of #615 -- based on discussion in #621 Fixes #621 Signed-off-by: Thomas Jackson --- api/prometheus/v1/api.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/prometheus/v1/api.go b/api/prometheus/v1/api.go index 06319a89f..e9300cd00 100644 --- a/api/prometheus/v1/api.go +++ b/api/prometheus/v1/api.go @@ -703,8 +703,12 @@ func (h *httpAPI) Series(ctx context.Context, matches []string, startTime time.T q.Add("match[]", m) } - q.Set("start", formatTime(startTime)) - q.Set("end", formatTime(endTime)) + if !startTime.IsZero() { + q.Set("start", formatTime(startTime)) + } + if !endTime.IsZero() { + q.Set("end", formatTime(endTime)) + } u.RawQuery = q.Encode()