Refactor deprecated inhibit rules matchers

This commit is contained in:
Andrei Nistor
2021-11-15 18:38:49 +02:00
parent 3301107f6a
commit 72f6ff3758
2 changed files with 12 additions and 20 deletions

View File

@@ -27,20 +27,12 @@ local defaults = {
resolve_timeout: '5m', resolve_timeout: '5m',
}, },
inhibit_rules: [{ inhibit_rules: [{
source_match: { source_matchers: ['severity = critical'],
severity: 'critical', target_matchers: ['severity =~ warning|info'],
},
target_match_re: {
severity: 'warning|info',
},
equal: ['namespace', 'alertname'], equal: ['namespace', 'alertname'],
}, { }, {
source_match: { source_matchers: ['severity = warning'],
severity: 'warning', target_matchers: ['severity = info'],
},
target_match_re: {
severity: 'info',
},
equal: ['namespace', 'alertname'], equal: ['namespace', 'alertname'],
}], }],
route: { route: {

View File

@@ -17,17 +17,17 @@ stringData:
- "equal": - "equal":
- "namespace" - "namespace"
- "alertname" - "alertname"
"source_match": "source_matchers":
"severity": "critical" - "severity = critical"
"target_match_re": "target_matchers":
"severity": "warning|info" - "severity =~ warning|info"
- "equal": - "equal":
- "namespace" - "namespace"
- "alertname" - "alertname"
"source_match": "source_matchers":
"severity": "warning" - "severity = warning"
"target_match_re": "target_matchers":
"severity": "info" - "severity = info"
"receivers": "receivers":
- "name": "Default" - "name": "Default"
- "name": "Watchdog" - "name": "Watchdog"