From 83698268082a8b22d07ca3f0ecb0215335586b0f Mon Sep 17 00:00:00 2001 From: Krasi Georgiev Date: Tue, 16 Jan 2018 09:47:53 +0000 Subject: [PATCH] comment to rethink the map reference for the notifier discovery --- cmd/prometheus/main.go | 1 + notifier/notifier.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 689827227..303a9d242 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -296,6 +296,7 @@ func main() { c := make(map[string]sd_config.ServiceDiscoveryConfig) for _, v := range cfg.AlertingConfig.AlertmanagerConfigs { // AlertmanagerConfigs doesn't hold an unique identifier so we use the config pointer as the identifier. + // TODO Krasi - Maybe use the slice index as the reference. c[fmt.Sprintf("%p", v)] = v.ServiceDiscoveryConfig } return discoveryManagerNotify.ApplyConfig(c) diff --git a/notifier/notifier.go b/notifier/notifier.go index bd4229a22..ba3e9d496 100644 --- a/notifier/notifier.go +++ b/notifier/notifier.go @@ -257,6 +257,7 @@ func (n *Notifier) ApplyConfig(conf *config.Config) error { ams.metrics = n.metrics // The config pointer is used for the map lookup identifier. + // TODO Krasi - Maybe use the slice index as the reference. amSets[fmt.Sprintf("%p", cfg)] = ams }