Reduce time that alertmanagers are in flux when reloaded. (#5126)

This no longer waits for all of the scrape reload to complete
before getting a list of AMs again.

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
This commit is contained in:
Brian Brazil 2019-01-28 18:34:12 +00:00 committed by GitHub
parent 8841692a63
commit 1dd57765b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -391,7 +391,6 @@ func main() {
webHandler.ApplyConfig, webHandler.ApplyConfig,
// The Scrape and notifier managers need to reload before the Discovery manager as // The Scrape and notifier managers need to reload before the Discovery manager as
// they need to read the most updated config when receiving the new targets list. // they need to read the most updated config when receiving the new targets list.
notifierManager.ApplyConfig,
scrapeManager.ApplyConfig, scrapeManager.ApplyConfig,
func(cfg *config.Config) error { func(cfg *config.Config) error {
c := make(map[string]sd_config.ServiceDiscoveryConfig) c := make(map[string]sd_config.ServiceDiscoveryConfig)
@ -400,6 +399,7 @@ func main() {
} }
return discoveryManagerScrape.ApplyConfig(c) return discoveryManagerScrape.ApplyConfig(c)
}, },
notifierManager.ApplyConfig,
func(cfg *config.Config) error { func(cfg *config.Config) error {
c := make(map[string]sd_config.ServiceDiscoveryConfig) c := make(map[string]sd_config.ServiceDiscoveryConfig)
for _, v := range cfg.AlertingConfig.AlertmanagerConfigs { for _, v := range cfg.AlertingConfig.AlertmanagerConfigs {