Skip to content

Commit

Permalink
Only set start/end if time is not Zero
Browse files Browse the repository at this point in the history
This is an updated PR of #615 -- based on discussion in #621

Fixes #621
  • Loading branch information
jacksontj committed Mar 21, 2023
1 parent 803ef2a commit fbcc2e2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/prometheus/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit fbcc2e2

Please sign in to comment.