diff --git a/api/prometheus/v1/api.go b/api/prometheus/v1/api.go index 345c0de..5078df1 100644 --- a/api/prometheus/v1/api.go +++ b/api/prometheus/v1/api.go @@ -231,17 +231,17 @@ type TargetsResult struct { // ActiveTarget models an active Prometheus scrape target. type ActiveTarget struct { - DiscoveredLabels model.LabelSet `json:"discoveredLabels"` - Labels model.LabelSet `json:"labels"` - ScrapeURL string `json:"scrapeUrl"` - LastError string `json:"lastError"` - LastScrape time.Time `json:"lastScrape"` - Health HealthStatus `json:"health"` + DiscoveredLabels map[string]string `json:"discoveredLabels"` + Labels model.LabelSet `json:"labels"` + ScrapeURL string `json:"scrapeUrl"` + LastError string `json:"lastError"` + LastScrape time.Time `json:"lastScrape"` + Health HealthStatus `json:"health"` } // DroppedTarget models a dropped Prometheus scrape target. type DroppedTarget struct { - DiscoveredLabels model.LabelSet `json:"discoveredLabels"` + DiscoveredLabels map[string]string `json:"discoveredLabels"` } // queryResult contains result data for a query. diff --git a/api/prometheus/v1/api_test.go b/api/prometheus/v1/api_test.go index c95ab3e..fec170e 100644 --- a/api/prometheus/v1/api_test.go +++ b/api/prometheus/v1/api_test.go @@ -605,7 +605,7 @@ func TestAPIs(t *testing.T) { res: TargetsResult{ Active: []ActiveTarget{ { - DiscoveredLabels: model.LabelSet{ + DiscoveredLabels: map[string]string{ "__address__": "127.0.0.1:9090", "__metrics_path__": "/metrics", "__scheme__": "http", @@ -623,7 +623,7 @@ func TestAPIs(t *testing.T) { }, Dropped: []DroppedTarget{ { - DiscoveredLabels: model.LabelSet{ + DiscoveredLabels: map[string]string{ "__address__": "127.0.0.1:9100", "__metrics_path__": "/metrics", "__scheme__": "http",