mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-28 06:59:40 -08:00
The config map was never reset on applying a new config
This commit is contained in:
parent
febebcd49a
commit
a981b51900
|
@ -83,9 +83,11 @@ func (m *ScrapeManager) Stop() {
|
||||||
func (m *ScrapeManager) ApplyConfig(cfg *config.Config) error {
|
func (m *ScrapeManager) ApplyConfig(cfg *config.Config) error {
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
m.actionCh <- func() {
|
m.actionCh <- func() {
|
||||||
|
c := make(map[string]*config.ScrapeConfig)
|
||||||
for _, scfg := range cfg.ScrapeConfigs {
|
for _, scfg := range cfg.ScrapeConfigs {
|
||||||
m.scrapeConfigs[scfg.JobName] = scfg
|
c[scfg.JobName] = scfg
|
||||||
}
|
}
|
||||||
|
m.scrapeConfigs = c
|
||||||
close(done)
|
close(done)
|
||||||
}
|
}
|
||||||
<-done
|
<-done
|
||||||
|
|
Loading…
Reference in a new issue