Inhibit info alerts unless other alerts fire (#1507)
* Inhibit info alerts unless other alerts fire * Fix nits
This commit is contained in:
@@ -35,6 +35,10 @@ local defaults = {
|
|||||||
source_matchers: ['severity = warning'],
|
source_matchers: ['severity = warning'],
|
||||||
target_matchers: ['severity = info'],
|
target_matchers: ['severity = info'],
|
||||||
equal: ['namespace', 'alertname'],
|
equal: ['namespace', 'alertname'],
|
||||||
|
}, {
|
||||||
|
source_matchers: ['alertname = InfoInhibitor'],
|
||||||
|
target_matchers: ['severity = info'],
|
||||||
|
equal: ['namespace'],
|
||||||
}],
|
}],
|
||||||
route: {
|
route: {
|
||||||
group_by: ['namespace'],
|
group_by: ['namespace'],
|
||||||
@@ -44,6 +48,7 @@ local defaults = {
|
|||||||
receiver: 'Default',
|
receiver: 'Default',
|
||||||
routes: [
|
routes: [
|
||||||
{ receiver: 'Watchdog', matchers: ['alertname = Watchdog'] },
|
{ receiver: 'Watchdog', matchers: ['alertname = Watchdog'] },
|
||||||
|
{ receiver: 'null', matchers: ['alertname = InfoInhibitor'] },
|
||||||
{ receiver: 'Critical', matchers: ['severity = critical'] },
|
{ receiver: 'Critical', matchers: ['severity = critical'] },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -51,6 +56,7 @@ local defaults = {
|
|||||||
{ name: 'Default' },
|
{ name: 'Default' },
|
||||||
{ name: 'Watchdog' },
|
{ name: 'Watchdog' },
|
||||||
{ name: 'Critical' },
|
{ name: 'Critical' },
|
||||||
|
{ name: 'null' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
replicas: 3,
|
replicas: 3,
|
||||||
|
|||||||
@@ -33,6 +33,24 @@
|
|||||||
severity: 'none',
|
severity: 'none',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
alert: 'InfoInhibitor',
|
||||||
|
annotations: {
|
||||||
|
summary: 'Info-level alert inhibition.',
|
||||||
|
description: |||
|
||||||
|
This is an alert that is used to inhibit info alerts.
|
||||||
|
By themselves, the info-level alerts are sometimes very noisy, but they are relevant when combined with
|
||||||
|
other alerts.
|
||||||
|
This alert fires whenever there's a severity="info" alert, and stops firing when another alert with a
|
||||||
|
severity of 'warning' or 'critical' starts firing on the same namespace.
|
||||||
|
This alert should be routed to a null receiver and configured to inhibit alerts with severity="info".
|
||||||
|
|||,
|
||||||
|
},
|
||||||
|
expr: 'ALERTS{severity = "info"} == 1 unless on(namespace) ALERTS{alertname != "InfoInhibitor", severity =~ "warning|critical", alertstate="firing"} == 1',
|
||||||
|
labels: {
|
||||||
|
severity: 'none',
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -28,10 +28,17 @@ stringData:
|
|||||||
- "severity = warning"
|
- "severity = warning"
|
||||||
"target_matchers":
|
"target_matchers":
|
||||||
- "severity = info"
|
- "severity = info"
|
||||||
|
- "equal":
|
||||||
|
- "namespace"
|
||||||
|
"source_matchers":
|
||||||
|
- "alertname = InfoInhibitor"
|
||||||
|
"target_matchers":
|
||||||
|
- "severity = info"
|
||||||
"receivers":
|
"receivers":
|
||||||
- "name": "Default"
|
- "name": "Default"
|
||||||
- "name": "Watchdog"
|
- "name": "Watchdog"
|
||||||
- "name": "Critical"
|
- "name": "Critical"
|
||||||
|
- "name": "null"
|
||||||
"route":
|
"route":
|
||||||
"group_by":
|
"group_by":
|
||||||
- "namespace"
|
- "namespace"
|
||||||
@@ -43,6 +50,9 @@ stringData:
|
|||||||
- "matchers":
|
- "matchers":
|
||||||
- "alertname = Watchdog"
|
- "alertname = Watchdog"
|
||||||
"receiver": "Watchdog"
|
"receiver": "Watchdog"
|
||||||
|
- "matchers":
|
||||||
|
- "alertname = InfoInhibitor"
|
||||||
|
"receiver": "null"
|
||||||
- "matchers":
|
- "matchers":
|
||||||
- "severity = critical"
|
- "severity = critical"
|
||||||
"receiver": "Critical"
|
"receiver": "Critical"
|
||||||
|
|||||||
@@ -38,6 +38,21 @@ spec:
|
|||||||
expr: vector(1)
|
expr: vector(1)
|
||||||
labels:
|
labels:
|
||||||
severity: none
|
severity: none
|
||||||
|
- alert: InfoInhibitor
|
||||||
|
annotations:
|
||||||
|
description: |
|
||||||
|
This is an alert that is used to inhibit info alerts.
|
||||||
|
By themselves, the info-level alerts are sometimes very noisy, but they are relevant when combined with
|
||||||
|
other alerts.
|
||||||
|
This alert fires whenever there's a severity="info" alert, and stops firing when another alert with a
|
||||||
|
severity of 'warning' or 'critical' starts firing on the same namespace.
|
||||||
|
This alert should be routed to a null receiver and configured to inhibit alerts with severity="info".
|
||||||
|
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/general/infoinhibitor
|
||||||
|
summary: Info-level alert inhibition.
|
||||||
|
expr: ALERTS{severity = "info"} == 1 unless on(namespace) ALERTS{alertname !=
|
||||||
|
"InfoInhibitor", severity =~ "warning|critical", alertstate="firing"} == 1
|
||||||
|
labels:
|
||||||
|
severity: none
|
||||||
- name: node-network
|
- name: node-network
|
||||||
rules:
|
rules:
|
||||||
- alert: NodeNetworkInterfaceFlapping
|
- alert: NodeNetworkInterfaceFlapping
|
||||||
|
|||||||
Reference in New Issue
Block a user