Merge pull request #186 from LiliC/fix-many2many
*: Fix AlertmanagerConfigInconsistent many-to-many matching errors
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
message: 'The configuration of the instances of the Alertmanager cluster `{{$labels.service}}` are out of sync.',
|
message: 'The configuration of the instances of the Alertmanager cluster `{{$labels.service}}` are out of sync.',
|
||||||
},
|
},
|
||||||
expr: |||
|
expr: |||
|
||||||
count_values("config_hash", alertmanager_config_hash{%(alertmanagerSelector)s}) BY (service) / ON(service) GROUP_LEFT() label_replace(prometheus_operator_spec_replicas{%(prometheusOperatorSelector)s,controller="alertmanager"}, "service", "alertmanager-$1", "name", "(.*)") != 1
|
count_values("config_hash", alertmanager_config_hash{%(alertmanagerSelector)s}) BY (service) / ON(service) GROUP_LEFT() label_replace(max(prometheus_operator_spec_replicas{%(prometheusOperatorSelector)s,controller="alertmanager"}) by (name, job, namespace, controller), "service", "alertmanager-$1", "name", "(.*)") != 1
|
||||||
||| % $._config,
|
||| % $._config,
|
||||||
'for': '5m',
|
'for': '5m',
|
||||||
labels: {
|
labels: {
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
alert:'AlertmanagerMembersInconsistent',
|
alert: 'AlertmanagerMembersInconsistent',
|
||||||
annotations:{
|
annotations: {
|
||||||
message: 'Alertmanager has not found all other members of the cluster.',
|
message: 'Alertmanager has not found all other members of the cluster.',
|
||||||
},
|
},
|
||||||
expr: |||
|
expr: |||
|
||||||
|
@@ -1054,7 +1054,7 @@ spec:
|
|||||||
message: The configuration of the instances of the Alertmanager cluster `{{$labels.service}}`
|
message: The configuration of the instances of the Alertmanager cluster `{{$labels.service}}`
|
||||||
are out of sync.
|
are out of sync.
|
||||||
expr: |
|
expr: |
|
||||||
count_values("config_hash", alertmanager_config_hash{job="alertmanager-main",namespace="monitoring"}) BY (service) / ON(service) GROUP_LEFT() label_replace(prometheus_operator_spec_replicas{job="prometheus-operator",namespace="monitoring",controller="alertmanager"}, "service", "alertmanager-$1", "name", "(.*)") != 1
|
count_values("config_hash", alertmanager_config_hash{job="alertmanager-main",namespace="monitoring"}) BY (service) / ON(service) GROUP_LEFT() label_replace(max(prometheus_operator_spec_replicas{job="prometheus-operator",namespace="monitoring",controller="alertmanager"}) by (name, job, namespace, controller), "service", "alertmanager-$1", "name", "(.*)") != 1
|
||||||
for: 5m
|
for: 5m
|
||||||
labels:
|
labels:
|
||||||
severity: critical
|
severity: critical
|
||||||
|
Reference in New Issue
Block a user