mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
Disallow multiple Alertmanager instances with the same URI
Unique uri is required for silence form result tracking
This commit is contained in:
@@ -21,6 +21,12 @@ func NewAlertmanager(name, uri string, timeout time.Duration) error {
|
||||
return fmt.Errorf("Alertmanager upstream '%s' already exist", name)
|
||||
}
|
||||
|
||||
for _, am := range upstreams {
|
||||
if am.URI == uri {
|
||||
return fmt.Errorf("Alertmanager upstream '%s' already collects from '%s'", am.Name, am.URI)
|
||||
}
|
||||
}
|
||||
|
||||
// initialize metrics
|
||||
metricAlertmanagerErrors.With(prometheus.Labels{
|
||||
"alertmanager": name,
|
||||
|
||||
Reference in New Issue
Block a user