Skip to content
Snippets Groups Projects
Unverified Commit 1d3dbe61 authored by Andrei Nistor's avatar Andrei Nistor Committed by GitHub
Browse files

Inhibit info alerts unless other alerts fire (#1507)

* Inhibit info alerts unless other alerts fire

* Fix nits
parent b2a250f3
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,10 @@ local defaults = {
source_matchers: ['severity = warning'],
target_matchers: ['severity = info'],
equal: ['namespace', 'alertname'],
}, {
source_matchers: ['alertname = InfoInhibitor'],
target_matchers: ['severity = info'],
equal: ['namespace'],
}],
route: {
group_by: ['namespace'],
......@@ -44,6 +48,7 @@ local defaults = {
receiver: 'Default',
routes: [
{ receiver: 'Watchdog', matchers: ['alertname = Watchdog'] },
{ receiver: 'null', matchers: ['alertname = InfoInhibitor'] },
{ receiver: 'Critical', matchers: ['severity = critical'] },
],
},
......@@ -51,6 +56,7 @@ local defaults = {
{ name: 'Default' },
{ name: 'Watchdog' },
{ name: 'Critical' },
{ name: 'null' },
],
},
replicas: 3,
......
......@@ -33,6 +33,24 @@
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"
"target_matchers":
- "severity = info"
- "equal":
- "namespace"
"source_matchers":
- "alertname = InfoInhibitor"
"target_matchers":
- "severity = info"
"receivers":
- "name": "Default"
- "name": "Watchdog"
- "name": "Critical"
- "name": "null"
"route":
"group_by":
- "namespace"
......@@ -43,6 +50,9 @@ stringData:
- "matchers":
- "alertname = Watchdog"
"receiver": "Watchdog"
- "matchers":
- "alertname = InfoInhibitor"
"receiver": "null"
- "matchers":
- "severity = critical"
"receiver": "Critical"
......
......@@ -38,6 +38,21 @@ spec:
expr: vector(1)
labels:
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
rules:
- alert: NodeNetworkInterfaceFlapping
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment