forked from mirror/client_golang
add missing fields to targets API
Signed-off-by: yeya24 <yb532204897@gmail.com>
This commit is contained in:
parent
17e98a7e4f
commit
45efe82b46
|
@ -382,9 +382,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"`
|
||||
}
|
||||
|
||||
|
|
|
@ -871,9 +871,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",
|
||||
},
|
||||
},
|
||||
|
@ -901,9 +904,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