Skip to content

Commit

Permalink
comment to rethink the map reference for the notifier discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
krasi-georgiev committed Jan 16, 2018
1 parent 2e058b1 commit 8369826
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/prometheus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 8369826

Please sign in to comment.