Skip to content

Commit 614ed45

Browse files
feat: connect dashboard incident workflows (#78)
* feat: connect dashboard incident workflows Show unknown telemetry and sample age, retain investigation filters and time, and link alert rules to triage instructions. * test: require both dashboard incident destinations
1 parent 967cd56 commit 614ed45

10 files changed

Lines changed: 755 additions & 81 deletions

File tree

‎config/grafana/alerting/projects.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ groups:
5454
labels:
5555
severity: critical
5656
annotations:
57+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
5758
summary: "No telemetry from {{ $labels.project }}/{{ $labels.env }} in 15m"
5859
description: "Host down, Docker down, the agent down, tunnel down, token rotated wrong, or the collector is rejecting this project's data. Nothing on the project side can detect this on its own. Expect this ~20m after the last sample: absent() needs the series to go stale first."
5960

@@ -94,5 +95,6 @@ groups:
9495
labels:
9596
severity: warning
9697
annotations:
98+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
9799
summary: "{{ $labels.project }}/{{ $labels.env }} is sending telemetry but has no alert rules"
98100
description: "Telemetry is arriving for a project/environment bootstrap.sh was never run for, so nothing would notice if it went silent. Run ./bootstrap.sh {{ $labels.project }} {{ $labels.env }} on the monitoring host. A literal `unknown` means the sender set no project or env resource attribute at all: fix the sender (docs/ONBOARDING.md), do not bootstrap a project by that name."

‎config/grafana/alerting/rules.yaml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ groups:
6363
labels:
6464
severity: none
6565
annotations:
66+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-delivery
6667
summary: "Alerting-pipeline heartbeat"
6768
description: >-
6869
Routed to a dead man's switch. Pings stop when Grafana cannot be scraped
@@ -81,6 +82,7 @@ groups:
8182
labels:
8283
severity: critical
8384
annotations:
85+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-delivery
8486
summary: "Grafana cannot deliver {{ $labels.integration }} notifications"
8587
description: >-
8688
Alerts are firing and going nowhere. Most likely an unset ALERT_WEBHOOK_URL,
@@ -103,6 +105,7 @@ groups:
103105
labels:
104106
severity: critical
105107
annotations:
108+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
106109
summary: "Scrape target {{ $labels.job }} is down"
107110
description: "Prometheus cannot scrape {{ $labels.instance }} (job {{ $labels.job }}) for 2 minutes."
108111
- uid: otel-export-failures
@@ -121,6 +124,7 @@ groups:
121124
labels:
122125
severity: warning
123126
annotations:
127+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
124128
summary: "OTel Collector failing to export via {{ $labels.exporter }}"
125129
description: >-
126130
The collector has been failing to deliver telemetry to a backend for
@@ -148,6 +152,7 @@ groups:
148152
labels:
149153
severity: warning
150154
annotations:
155+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
151156
# Spoke series carry host_name; the central node-exporter only instance.
152157
summary: "Filesystem {{ $labels.mountpoint }} on {{ or $labels.host_name $labels.instance }} is over 80% full"
153158
description: >-
@@ -170,6 +175,7 @@ groups:
170175
labels:
171176
severity: warning
172177
annotations:
178+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
173179
summary: >-
174180
Filesystem {{ $labels.mountpoint }} on {{ or $labels.host_name $labels.instance }}
175181
fills up within 3 days at the current rate
@@ -193,6 +199,7 @@ groups:
193199
labels:
194200
severity: warning
195201
annotations:
202+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
196203
summary: "Memory on {{ or $labels.host_name $labels.instance }} is over 90% used"
197204
description: >-
198205
Sustained for 15 minutes. The OOM killer picks by RSS, so the next
@@ -216,6 +223,7 @@ groups:
216223
labels:
217224
severity: warning
218225
annotations:
226+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
219227
summary: "Prometheus holds {{ $values.QUERY }} active series, over the 30k ceiling"
220228
description: >-
221229
Find the label that exploded with
@@ -241,6 +249,7 @@ groups:
241249
labels:
242250
severity: warning
243251
annotations:
252+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
244253
summary: "Prometheus gained {{ $values.QUERY }} active series in 30 minutes"
245254
description: >-
246255
Far faster than onboarding a spoke explains, so a label has most
@@ -267,6 +276,7 @@ groups:
267276
labels:
268277
severity: warning
269278
annotations:
279+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
270280
summary: "Container {{ $labels.name }} is crash-looping"
271281
description: "{{ $labels.name }} on {{ $labels.host_name }} has restarted more than 3 times in the last hour."
272282
- uid: container-oom-killed
@@ -282,6 +292,7 @@ groups:
282292
labels:
283293
severity: warning
284294
annotations:
295+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
285296
summary: "Container {{ $labels.name }} was OOM-killed"
286297
description: "{{ $labels.name }} on {{ $labels.host_name }} hit an OOM kill in the last 5 minutes."
287298
- orgId: 1
@@ -307,6 +318,7 @@ groups:
307318
labels:
308319
severity: warning
309320
annotations:
321+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
310322
summary: "{{ $labels.project }}/{{ $labels.env }} {{ $labels.job }} error rate above 5%"
311323
description: >-
312324
More than 5% of requests to {{ $labels.job }}
@@ -329,6 +341,7 @@ groups:
329341
labels:
330342
severity: warning
331343
annotations:
344+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
332345
summary: "{{ $labels.project }}/{{ $labels.env }} {{ $labels.job }} p99 latency above 2s"
333346
description: >-
334347
The slowest 1% of requests to {{ $labels.job }}
@@ -347,6 +360,7 @@ groups:
347360
labels:
348361
severity: critical
349362
annotations:
363+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
350364
summary: "Outside-in HTTP probe failed for {{ $labels.instance }}"
351365
description: "Blackbox prober failed to reach {{ $labels.instance }} for 2 minutes."
352366
# Google SRE multi-window burn rate alerts for a 99.5% availability SLO
@@ -373,6 +387,7 @@ groups:
373387
labels:
374388
severity: critical
375389
annotations:
390+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
376391
summary: "{{ $labels.project }}/{{ $labels.env }} {{ $labels.job }} 14.4x error budget burn (fast burn)"
377392
description: >-
378393
Consuming 2% of the 30-day 99.5% error budget within 1 hour.
@@ -400,6 +415,7 @@ groups:
400415
labels:
401416
severity: warning
402417
annotations:
418+
runbook_url: https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#alert-catalog
403419
summary: "{{ $labels.project }}/{{ $labels.env }} {{ $labels.job }} 6x error budget burn (slow burn)"
404420
description: >-
405421
Consuming 5% of the 30-day 99.5% error budget within 6 hours.

‎dashboards/logs.json‎

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
"project"
88
],
99
"links": [
10+
{
11+
"title": "Service metrics",
12+
"type": "link",
13+
"icon": "dashboard",
14+
"url": "/d/service-health/service-health",
15+
"includeVars": true,
16+
"keepTime": true,
17+
"targetBlank": false
18+
},
1019
{
1120
"asDropdown": false,
1221
"icon": "dashboard",
@@ -20,6 +29,13 @@
2029
"tooltip": "Switch to another dashboard in the CML monitoring stack",
2130
"type": "dashboards",
2231
"url": ""
32+
},
33+
{
34+
"title": "Incident runbook",
35+
"type": "link",
36+
"icon": "book",
37+
"url": "https://github.com/CMLPlatform/monitoring/blob/main/docs/RUNBOOK.md#incident-workflow",
38+
"targetBlank": true
2339
}
2440
],
2541
"time": {
@@ -42,7 +58,7 @@
4258
},
4359
"definition": "label_values(project)",
4460
"query": "label_values(project)",
45-
"refresh": 1,
61+
"refresh": 2,
4662
"sort": 1,
4763
"current": {},
4864
"options": [],
@@ -58,7 +74,7 @@
5874
},
5975
"definition": "label_values({project=\"$project\"}, env)",
6076
"query": "label_values({project=\"$project\"}, env)",
61-
"refresh": 1,
77+
"refresh": 2,
6278
"sort": 1,
6379
"current": {},
6480
"options": [],
@@ -74,7 +90,7 @@
7490
},
7591
"definition": "label_values({project=\"$project\", env=\"$env\"}, service_name)",
7692
"query": "label_values({project=\"$project\", env=\"$env\"}, service_name)",
77-
"refresh": 1,
93+
"refresh": 2,
7894
"sort": 1,
7995
"current": {
8096
"text": "All",
@@ -88,6 +104,21 @@
88104
]
89105
},
90106
"panels": [
107+
{
108+
"id": 100,
109+
"type": "text",
110+
"title": "Incident workflow",
111+
"gridPos": {
112+
"h": 4,
113+
"w": 24,
114+
"x": 0,
115+
"y": 0
116+
},
117+
"options": {
118+
"mode": "markdown",
119+
"content": "Compare errors with All Logs. Follow trace IDs into Tempo. Confirm recovery with fresh Service metrics; missing logs do not prove health."
120+
}
121+
},
91122
{
92123
"type": "timeseries",
93124
"title": "Log Rate by Service",
@@ -96,7 +127,7 @@
96127
"h": 8,
97128
"w": 12,
98129
"x": 0,
99-
"y": 0
130+
"y": 4
100131
},
101132
"id": 1,
102133
"datasource": {
@@ -105,7 +136,7 @@
105136
},
106137
"targets": [
107138
{
108-
"expr": "sum by (service_name) (rate({project=\"$project\", env=\"$env\", service_name=~\"$service\"}[$__auto]))",
139+
"expr": "sum by (service_name) (rate({project=\"$project\", env=\"$env\", service_name=~\"${service:regex}\"}[$__auto]))",
109140
"legendFormat": "{{service_name}}",
110141
"refId": "A"
111142
}
@@ -124,12 +155,12 @@
124155
{
125156
"type": "timeseries",
126157
"title": "Log Rate by Level",
127-
"description": "A rising error line is the cheapest early warning here.",
158+
"description": "Rate by Loki-detected level. Missing levels or an empty result are not proof that errors stopped; compare All Logs and service metrics.",
128159
"gridPos": {
129160
"h": 8,
130161
"w": 12,
131162
"x": 12,
132-
"y": 0
163+
"y": 4
133164
},
134165
"id": 2,
135166
"datasource": {
@@ -138,7 +169,7 @@
138169
},
139170
"targets": [
140171
{
141-
"expr": "sum by (detected_level) (rate({project=\"$project\", env=\"$env\", service_name=~\"$service\"}[$__auto]))",
172+
"expr": "sum by (detected_level) (rate({project=\"$project\", env=\"$env\", service_name=~\"${service:regex}\"}[$__auto]))",
142173
"legendFormat": "{{detected_level}}",
143174
"refId": "A"
144175
}
@@ -162,7 +193,7 @@
162193
"h": 10,
163194
"w": 24,
164195
"x": 0,
165-
"y": 8
196+
"y": 12
166197
},
167198
"id": 3,
168199
"datasource": {
@@ -171,7 +202,7 @@
171202
},
172203
"targets": [
173204
{
174-
"expr": "{project=\"$project\", env=\"$env\", service_name=~\"$service\"} | detected_level=~\"(?i)(error|critical|fatal|warn)\"",
205+
"expr": "{project=\"$project\", env=\"$env\", service_name=~\"${service:regex}\"} | detected_level=~\"(?i)(error|critical|fatal|warn)\"",
175206
"refId": "A"
176207
}
177208
],
@@ -190,7 +221,7 @@
190221
"h": 10,
191222
"w": 24,
192223
"x": 0,
193-
"y": 18
224+
"y": 22
194225
},
195226
"id": 4,
196227
"datasource": {
@@ -199,7 +230,7 @@
199230
},
200231
"targets": [
201232
{
202-
"expr": "{project=\"$project\", env=\"$env\", service_name=~\"$service\"}",
233+
"expr": "{project=\"$project\", env=\"$env\", service_name=~\"${service:regex}\"}",
203234
"refId": "A"
204235
}
205236
],

0 commit comments

Comments
 (0)