mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 00:13:30 +01:00
lib/promscrape: create a single swosFunc
per scrape_config
This commit is contained in:
parent
084ee9f598
commit
3b1f0cb3f6
@ -130,7 +130,6 @@ type ScrapeConfig struct {
|
||||
}
|
||||
|
||||
func (sc *ScrapeConfig) mustStart(baseDir string) {
|
||||
for i := range sc.KubernetesSDConfigs {
|
||||
swosFunc := func(metaLabels map[string]string) interface{} {
|
||||
target := metaLabels["__address__"]
|
||||
sw, err := sc.swc.getScrapeWork(target, nil, metaLabels)
|
||||
@ -140,6 +139,7 @@ func (sc *ScrapeConfig) mustStart(baseDir string) {
|
||||
}
|
||||
return sw
|
||||
}
|
||||
for i := range sc.KubernetesSDConfigs {
|
||||
sc.KubernetesSDConfigs[i].MustStart(baseDir, swosFunc)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user