diff --git a/api/prometheus/v1/api.go b/api/prometheus/v1/api.go index b77294778..13b36464d 100644 --- a/api/prometheus/v1/api.go +++ b/api/prometheus/v1/api.go @@ -682,6 +682,8 @@ func (h *httpAPI) LabelNames(ctx context.Context, startTime time.Time, endTime t q.Set("start", formatTime(startTime)) q.Set("end", formatTime(endTime)) + u.RawQuery = q.Encode() + req, err := http.NewRequest(http.MethodGet, u.String(), nil) if err != nil { return nil, nil, err @@ -700,6 +702,8 @@ func (h *httpAPI) LabelValues(ctx context.Context, label string, startTime time. q.Set("start", formatTime(startTime)) q.Set("end", formatTime(endTime)) + u.RawQuery = q.Encode() + req, err := http.NewRequest(http.MethodGet, u.String(), nil) if err != nil { return nil, nil, err