Skip to content

Commit 3df22a4

Browse files
authored
Merge pull request #771 from yeya24/fix-time-range-propagation
Fix time parameter propagation in labels API
2 parents 0238879 + 94ae577 commit 3df22a4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/prometheus/v1/api.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,8 @@ func (h *httpAPI) LabelNames(ctx context.Context, startTime time.Time, endTime t
682682
q.Set("start", formatTime(startTime))
683683
q.Set("end", formatTime(endTime))
684684

685+
u.RawQuery = q.Encode()
686+
685687
req, err := http.NewRequest(http.MethodGet, u.String(), nil)
686688
if err != nil {
687689
return nil, nil, err
@@ -700,6 +702,8 @@ func (h *httpAPI) LabelValues(ctx context.Context, label string, startTime time.
700702
q.Set("start", formatTime(startTime))
701703
q.Set("end", formatTime(endTime))
702704

705+
u.RawQuery = q.Encode()
706+
703707
req, err := http.NewRequest(http.MethodGet, u.String(), nil)
704708
if err != nil {
705709
return nil, nil, err

0 commit comments

Comments
 (0)