@@ -232,9 +232,9 @@ type API interface {
232
232
// Flags returns the flag values that Prometheus was launched with.
233
233
Flags (ctx context.Context ) (FlagsResult , error )
234
234
// LabelNames returns all the unique label names present in the block in sorted order.
235
- LabelNames (ctx context.Context ) ([]string , Warnings , error )
235
+ LabelNames (ctx context.Context , startTime time. Time , endTime time. Time ) ([]string , Warnings , error )
236
236
// LabelValues performs a query for the values of the given label.
237
- LabelValues (ctx context.Context , label string ) (model.LabelValues , Warnings , error )
237
+ LabelValues (ctx context.Context , label string , startTime time. Time , endTime time. Time ) (model.LabelValues , Warnings , error )
238
238
// Query performs a query for the given time.
239
239
Query (ctx context.Context , query string , ts time.Time ) (model.Value , Warnings , error )
240
240
// QueryRange performs a query for the given range.
@@ -676,8 +676,12 @@ func (h *httpAPI) Runtimeinfo(ctx context.Context) (RuntimeinfoResult, error) {
676
676
return res , json .Unmarshal (body , & res )
677
677
}
678
678
679
- func (h * httpAPI ) LabelNames (ctx context.Context ) ([]string , Warnings , error ) {
679
+ func (h * httpAPI ) LabelNames (ctx context.Context , startTime time. Time , endTime time. Time ) ([]string , Warnings , error ) {
680
680
u := h .client .URL (epLabels , nil )
681
+ q := u .Query ()
682
+ q .Set ("start" , formatTime (startTime ))
683
+ q .Set ("end" , formatTime (endTime ))
684
+
681
685
req , err := http .NewRequest (http .MethodGet , u .String (), nil )
682
686
if err != nil {
683
687
return nil , nil , err
@@ -690,8 +694,12 @@ func (h *httpAPI) LabelNames(ctx context.Context) ([]string, Warnings, error) {
690
694
return labelNames , w , json .Unmarshal (body , & labelNames )
691
695
}
692
696
693
- func (h * httpAPI ) LabelValues (ctx context.Context , label string ) (model.LabelValues , Warnings , error ) {
697
+ func (h * httpAPI ) LabelValues (ctx context.Context , label string , startTime time. Time , endTime time. Time ) (model.LabelValues , Warnings , error ) {
694
698
u := h .client .URL (epLabelValues , map [string ]string {"name" : label })
699
+ q := u .Query ()
700
+ q .Set ("start" , formatTime (startTime ))
701
+ q .Set ("end" , formatTime (endTime ))
702
+
695
703
req , err := http .NewRequest (http .MethodGet , u .String (), nil )
696
704
if err != nil {
697
705
return nil , nil , err
0 commit comments