Skip to content

Commit 80e8980

Browse files
authored
Fixes a bug in the AM configuration that was causing it to crash loop. (#292)
* Fixes a misconfigured inhibit rule. AM expects a map, not a list. * Attempts to configure target_match per the documentation. * Uses target_match_re eliminate the dupliate key names. * Fixes inhibit rule for snmp-exporter as well. * Adds comments to inhibit rules on what having an empty list for 'equal' means
1 parent 08c3629 commit 80e8980

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

config/federation/alertmanager/config.yml.template

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,22 @@ inhibit_rules:
7171

7272
# Various other checks rely on the script-exporter being up. If the
7373
# script-exporter is not up, then don't alert on those dependencies.
74+
# The empty `equal` parameter tells AM to not attempt a match on any other
75+
# labels i.e., `source_match` and `target_match_re` are sufficient.
7476
- source_match:
75-
- alertname: 'ScriptExporterDownOrMissing'
76-
target_match:
77-
- alertname: 'ScriptExporterMissingMetrics'
78-
- alertname: 'TooManyNdtServersDown'
77+
alertname: 'ScriptExporterDownOrMissing'
78+
target_match_re:
79+
alertname: 'ScriptExporterMissingMetrics|TooManyNdtServersDown'
7980
equal: []
8081

8182
# Don't alert on missing SNMP metrics or SNMP scraping being broken if the
82-
# snmp-exporter is down.
83+
# snmp-exporter is down. The empty `equal` parameter tells AM to not attempt a
84+
# match on any other labels i.e., `source_match` and `target_match_re` are
85+
# sufficient.
8386
- source_match:
84-
- alertname: 'SnmpExporterDownOrMissing'
85-
target_match:
86-
- alertname: 'SnmpExporterMissingMetrics'
87-
- alertname: 'SnmpScrapingDownAtSite'
87+
alertname: 'SnmpExporterDownOrMissing'
88+
target_match_re:
89+
alertname: 'SnmpExporterMissingMetrics|SnmpScrapingDownAtSite'
8890
equal: []
8991

9092
receivers:

0 commit comments

Comments
 (0)