Merge pull request #856 from yeya24/targets-field
Add missing fields to targets API
This commit is contained in:
commit
4a22844c5d
|
@ -387,9 +387,12 @@ type TargetsResult struct {
|
|||
type ActiveTarget struct {
|
||||
DiscoveredLabels map[string]string `json:"discoveredLabels"`
|
||||
Labels model.LabelSet `json:"labels"`
|
||||
ScrapePool string `json:"scrapePool"`
|
||||
ScrapeURL string `json:"scrapeUrl"`
|
||||
GlobalURL string `json:"globalUrl"`
|
||||
LastError string `json:"lastError"`
|
||||
LastScrape time.Time `json:"lastScrape"`
|
||||
LastScrapeDuration float64 `json:"lastScrapeDuration"`
|
||||
Health HealthStatus `json:"health"`
|
||||
}
|
||||
|
||||
|
|
|
@ -976,9 +976,12 @@ func TestAPIs(t *testing.T) {
|
|||
"instance": "127.0.0.1:9090",
|
||||
"job": "prometheus",
|
||||
},
|
||||
"scrapePool": "prometheus",
|
||||
"scrapeUrl": "http://127.0.0.1:9090",
|
||||
"globalUrl": "http://127.0.0.1:9090",
|
||||
"lastError": "error while scraping target",
|
||||
"lastScrape": testTime.UTC().Format(time.RFC3339Nano),
|
||||
"lastScrapeDuration": 0.001146115,
|
||||
"health": "up",
|
||||
},
|
||||
},
|
||||
|
@ -1006,9 +1009,12 @@ func TestAPIs(t *testing.T) {
|
|||
"instance": "127.0.0.1:9090",
|
||||
"job": "prometheus",
|
||||
},
|
||||
ScrapePool: "prometheus",
|
||||
ScrapeURL: "http://127.0.0.1:9090",
|
||||
GlobalURL: "http://127.0.0.1:9090",
|
||||
LastError: "error while scraping target",
|
||||
LastScrape: testTime.UTC(),
|
||||
LastScrapeDuration: 0.001146115,
|
||||
Health: HealthGood,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue