]> git.openstreetmap.org Git - chef.git/blob - cookbooks/prometheus/templates/default/alert_rules.yml.erb
Increase alert threshold for OSM overpass database
[chef.git] / cookbooks / prometheus / templates / default / alert_rules.yml.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 groups:
4   - name: amsterdam
5     rules:
6       - alert: pdu current draw
7         expr: rPDU2PhaseStatusCurrent{site="amsterdam",rPDU2PhaseStatusIndex="1"} / 10 > 10
8         for: 5m
9         labels:
10           alertgroup: "amsterdam"
11         annotations:
12           current: "{{ $value | humanize }}A"
13       - alert: site current draw
14         expr: sum(rPDU2PhaseStatusCurrent{site="amsterdam",rPDU2PhaseStatusIndex="1"} / 10) > 13
15         for: 5m
16         labels:
17           alertgroup: "amsterdam"
18         annotations:
19           current: "{{ $value | humanize }}A"
20       - alert: site temperature
21         expr: min(rPDU2SensorTempHumidityStatusTempC{site="amsterdam"}) / 10 < 18 or min(rPDU2SensorTempHumidityStatusTempC{site="amsterdam"}) / 10 > 25
22         for: 5m
23         labels:
24           alertgroup: "amsterdam"
25         annotations:
26           temperature: "{{ $value | humanize }}C"
27       - alert: site humidity
28         expr: max(rPDU2SensorTempHumidityStatusRelativeHumidity{site="amsterdam"}) / 100 < 0.25 or max(rPDU2SensorTempHumidityStatusRelativeHumidity{site="amsterdam"}) / 100 > 0.65
29         for: 5m
30         labels:
31           alertgroup: "amsterdam"
32         annotations:
33           humidity: "{{ $value | humanizePercentage }}"
34   - name: apache
35     rules:
36       - alert: apache down
37         expr: apache_up == 0
38         for: 5m
39         labels:
40           alertgroup: "{{ $labels.instance }}"
41       - alert: apache workers busy
42         expr: sum(apache_workers{state="busy"}) by (instance) / sum(apache_scoreboard) by (instance) > 0.8
43         for: 5m
44         labels:
45           alertgroup: "{{ $labels.instance }}"
46         annotations:
47           busy_workers: "{{ $value | humanizePercentage }}"
48       - alert: apache low request rate
49         expr: rate(apache_accesses_total[5m]) / rate(apache_accesses_total[1h] offset 1w) < 0.25 and rate(apache_accesses_total[1h] offset 1w) > 2
50         for: 15m
51         labels:
52           alertgroup: "{{ $labels.instance }}"
53         annotations:
54           request_rate: "{{ $value | humanizePercentage }}"
55   - name: chef
56     rules:
57       - alert: chef client not running
58         expr: time() - node_systemd_timer_last_trigger_seconds{name="chef-client.timer"} > 3600
59         for: 12h
60         labels:
61           alertgroup: "{{ $labels.instance }}"
62         annotations:
63           down_time: "{{ $value | humanizeDuration }}"
64   - name: cisco
65     rules:
66       - alert: cisco fan alarm
67         expr: rlPhdUnitEnvParamFan1Status{rlPhdUnitEnvParamFan1Status!="normal"} > 0 or rlPhdUnitEnvParamFan2Status{rlPhdUnitEnvParamFan2Status!="normal"} > 0
68         for: 5m
69         labels:
70           alertgroup: "{{ $labels.site }}"
71         annotations:
72           fan_rpm: "{{ with printf \"rlPhdUnitEnvParamFan1Speed{site='%s',instance='%s',rlPhdUnitEnvParamStackUnit='%s'}\" $labels.site $labels.instance $labels.rlPhdUnitEnvParamStackUnit | query }}{{ . | first | value | humanize }}rpm{{end}}"
73       - alert: cisco temperature alarm
74         expr: rlPhdUnitEnvParamTempSensorStatus{rlPhdUnitEnvParamTempSensorStatus!="ok"} > 0
75         for: 5m
76         labels:
77           alertgroup: "{{ $labels.site }}"
78         annotations:
79           temp_celsius: "{{ with printf \"rlPhdUnitEnvParamTempSensorValue{site='%s',instance='%s',rlPhdUnitEnvParamStackUnit='%s'}\" $labels.site $labels.instance $labels.rlPhdUnitEnvParamStackUnit | query }}{{ . | first | value | humanize }}C{{end}}"
80       - alert: cisco main power alarm
81         expr: rlPhdUnitEnvParamMainPSStatus{rlPhdUnitEnvParamMainPSStatus!="normal"} > 0
82         for: 5m
83         labels:
84           alertgroup: "{{ $labels.site }}"
85       - alert: cisco redundant power alarm
86         expr: rlPhdUnitEnvParamRedundantPSStatus{rlPhdUnitEnvParamRedundantPSStatus!="normal"} > 0
87         for: 5m
88         labels:
89           alertgroup: "{{ $labels.site }}"
90   - name: cpu
91     rules:
92       - alert: cpu pressure
93         expr: rate(node_pressure_cpu_waiting_seconds_total[5m]) > 0.6
94         for: 15m
95         labels:
96           alertgroup: "{{ $labels.instance }}"
97         annotations:
98           pressure: "{{ $value | humanizePercentage }}"
99   - name: database
100     rules:
101       - alert: postgres replication delay
102         expr: pg_replication_lag_seconds > 5
103         for: 5m
104         labels:
105           alertgroup: database
106         annotations:
107           delay: "{{ $value | humanizeDuration }}"
108   - name: dublin
109     rules:
110       - alert: pdu current draw
111         expr: rPDU2PhaseStatusCurrent{site="dublin",rPDU2PhaseStatusIndex="1"} / 10 > 13
112         for: 5m
113         labels:
114           alertgroup: "dublin"
115         annotations:
116           current: "{{ $value | humanize }}A"
117       - alert: site current draw
118         expr: sum(rPDU2PhaseStatusCurrent{site="dublin",rPDU2PhaseStatusIndex="1"} / 10) > 17
119         for: 5m
120         labels:
121           alertgroup: "dublin"
122         annotations:
123           current: "{{ $value | humanize }}A"
124       - alert: site temperature
125         expr: min(rPDU2SensorTempHumidityStatusTempC{site="dublin"}) / 10 < 18 or min(rPDU2SensorTempHumidityStatusTempC{site="dublin"}) / 10 > 25
126         for: 5m
127         labels:
128           alertgroup: "dublin"
129         annotations:
130           temperature: "{{ $value | humanize }}C"
131       - alert: site humidity
132         expr: max(rPDU2SensorTempHumidityStatusRelativeHumidity{site="dublin"}) / 100 < 0.25 or max(rPDU2SensorTempHumidityStatusRelativeHumidity{site="dublin"}) / 100 > 0.65
133         for: 5m
134         labels:
135           alertgroup: "dublin"
136         annotations:
137           humidity: "{{ $value | humanizePercentage }}"
138   - name: fastly
139     rules:
140       - alert: fastly error rate
141         expr: sum(rate(fastly_rt_status_group_total{status_group="5xx"}[5m])) by (service_name, datacenter) / sum(rate(fastly_rt_status_group_total[5m])) by (service_name, datacenter) > 0.005
142         for: 15m
143         labels:
144           alertgroup: fastly
145         annotations:
146           error_rate: "{{ $value | humanizePercentage }}"
147       - alert: fastly healthcheck failing
148         expr: count(fastly_healthcheck_status == 0) > 0
149         for: 15m
150         labels:
151           alertgroup: fastly
152       - alert: multipe fastly healthchecks failing
153         expr: count(fastly_healthcheck_status == 0) > 4
154         for: 5m
155         labels:
156           alertgroup: fastly
157   - name: filesystem
158     rules:
159       - alert: readonly filesystem
160         expr: node_filesystem_readonly == 1
161         for: 0m
162         labels:
163           alertgroup: "{{ $labels.instance }}"
164       - alert: filesystem low on space
165         expr: node_filesystem_avail_bytes / node_filesystem_size_bytes < 0.05
166         for: 5m
167         labels:
168           alertgroup: "{{ $labels.instance }}"
169         annotations:
170           percentage_free: "{{ $value | humanizePercentage }}"
171           free_bytes: "{{ with printf \"node_filesystem_avail_bytes{instance='%s',mountpoint='%s'}\" $labels.instance $labels.mountpoint | query }}{{ . | first | value | humanize1024 }}bytes{{end}}"
172           total_total: "{{ with printf \"node_filesystem_size_bytes{instance='%s',mountpoint='%s'}\" $labels.instance $labels.mountpoint | query }}{{ . | first | value | humanize1024 }}bytes{{end}}"
173       - alert: filesystem low on inodes
174         expr: node_filesystem_files_free / node_filesystem_files < 0.1
175         for: 5m
176         labels:
177           alertgroup: "{{ $labels.instance }}"
178         annotations:
179           percentage_free: "{{ $value | humanizePercentage }}"
180           free_inodes: "{{ with printf \"node_filesystem_files_free{instance='%s',mountpoint='%s'}\" $labels.instance $labels.mountpoint | query }}{{ . | first | value }}{{end}}"
181           total_inodes: "{{ with printf \"node_filesystem_files{instance='%s',mountpoint='%s'}\" $labels.instance $labels.mountpoint | query }}{{ . | first | value }}{{end}}"
182   - name: hwmon
183     rules:
184       - alert: hwmon fan alarm
185         expr: node_hwmon_fan_alarm == 1
186         for: 5m
187         labels:
188           alertgroup: "{{ $labels.instance }}"
189         annotations:
190           fan_rpm: "{{ with printf \"node_hwmon_fan_rpm{instance='%s',chip='%s',sensor='%s'}\" $labels.instance $labels.chip $labels.sensor | query }}{{ . | first | value | humanize }}rpm{{end}}"
191           fan_min_rpm: "{{ with printf \"node_hwmon_fan_min_rpm{instance='%s',chip='%s',sensor='%s'}\" $labels.instance $labels.chip $labels.sensor | query }}{{ . | first | value | humanize }}rpm{{end}}"
192       - alert: hwmon temperature alarm
193         expr: node_hwmon_temp_alarm == 1
194         for: 5m
195         labels:
196           alertgroup: "{{ $labels.instance }}"
197         annotations:
198           temp_celsius: "{{ with printf \"node_hwmon_temp_celsius{instance='%s',chip='%s',sensor='%s'}\" $labels.instance $labels.chip $labels.sensor | query }}{{ . | first | value | humanize }}C{{end}}"
199           temp_max_celsius: "{{ with printf \"node_hwmon_temp_max_celsius{instance='%s',chip='%s',sensor='%s'}\" $labels.instance $labels.chip $labels.sensor | query }}{{ . | first | value | humanize }}C{{end}}"
200           temp_crit_celsius: "{{ with printf \"node_hwmon_temp_crit_celsius{instance='%s',chip='%s',sensor='%s'}\" $labels.instance $labels.chip $labels.sensor | query }}{{ . | first | value | humanize }}C{{end}}"
201       - alert: hwmon voltage alarm
202         expr: node_hwmon_in_alarm == 1
203         for: 5m
204         labels:
205           alertgroup: "{{ $labels.instance }}"
206         annotations:
207           in_volts: "{{ with printf \"node_hwmon_in_volts{instance='%s',chip='%s',sensor='%s'}\" $labels.instance $labels.chip $labels.sensor | query }}{{ . | first | value | humanize }}V{{end}}"
208           in_min_volts: "{{ with printf \"node_hwmon_in_min_volts{instance='%s',chip='%s',sensor='%s'}\" $labels.instance $labels.chip $labels.sensor | query }}{{ . | first | value | humanize }}V{{end}}"
209           in_max_volts: "{{ with printf \"node_hwmon_in_max_volts{instance='%s',chip='%s',sensor='%s'}\" $labels.instance $labels.chip $labels.sensor | query }}{{ . | first | value | humanize }}V{{end}}"
210   - name: io
211     rules:
212       - alert: io pressure
213         expr: rate(node_pressure_io_waiting_seconds_total[5m]) > 0.6
214         for: 60m
215         labels:
216           alertgroup: "{{ $labels.instance }}"
217         annotations:
218           pressure: "{{ $value | humanizePercentage }}"
219   - name: ipmi
220     rules:
221       - alert: ipmi fan alarm
222         expr: ipmi_fan_speed_state > 0
223         for: 5m
224         labels:
225           alertgroup: "{{ $labels.instance }}"
226         annotations:
227           fan_speed_rpm: "{{ with printf \"ipmi_fan_speed_rpm{instance='%s',id='%s'}\" $labels.instance $labels.id | query }}{{ . | first | value | humanize }}rpm{{end}}"
228       - alert: ipmi temperature alarm
229         expr: ipmi_temperature_state > 0
230         for: 5m
231         labels:
232           alertgroup: "{{ $labels.instance }}"
233         annotations:
234           temperature_celsius: "{{ with printf \"ipmi_temperature_celsius{instance='%s',id='%s'}\" $labels.instance $labels.id | query }}{{ . | first | value | humanize }}C{{end}}"
235       - alert: ipmi voltage alarm
236         expr: ipmi_voltage_state > 0
237         for: 5m
238         labels:
239           alertgroup: "{{ $labels.instance }}"
240         annotations:
241           voltage_volts: "{{ with printf \"ipmi_voltage_volts{instance='%s',id='%s'}\" $labels.instance $labels.id | query }}{{ . | first | value | humanize }}V{{end}}"
242       - alert: ipmi power alarm
243         expr: ipmi_power_state > 0 or ipmi_sensor_state{type=~"Power .*"} > 0
244         for: 5m
245         labels:
246           alertgroup: "{{ $labels.instance }}"
247   - name: juniper
248     rules:
249       - alert: juniper fan alarm
250         expr: sum_over_time(jnxOperatingState{jnxOperatingContentsIndex="4",jnxOperatingState!="running"}[6m]) > 0
251         for: 5m
252         labels:
253           alertgroup: "{{ $labels.site }}"
254       - alert: juniper power alarm
255         expr: sum_over_time(jnxOperatingState{jnxOperatingContentsIndex="2",jnxOperatingState!="running"}[6m]) > 0
256         for: 5m
257         labels:
258           alertgroup: "{{ $labels.site }}"
259   - name: mail
260     rules:
261       - alert: exim queue length
262         expr: exim_queue > exim_queue_limit
263         for: 60m
264         labels:
265           alertgroup: mail
266         annotations:
267           queue_length: "{{ $value }}"
268       - alert: mailman queue length
269         expr: mailman_queue_length > 200
270         for: 60m
271         labels:
272           alertgroup: mail
273         annotations:
274           queue_length: "{{ $value }}"
275   - name: mdadm
276     rules:
277       - alert: mdadm array inactive
278         expr: node_md_state{state="inactive"} > 0
279         for: 0m
280         labels:
281           alertgroup: "{{ $labels.instance }}"
282         annotations:
283           required: "{{ with printf \"node_md_disks_required{instance='%s',device='%s'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
284           active: "{{ with printf \"node_md_disks{instance='%s',device='%s',state='active'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
285           failed: "{{ with printf \"node_md_disks{instance='%s',device='%s',state='failed'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
286           spare: "{{ with printf \"node_md_disks{instance='%s',device='%s',state='spare'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
287       - alert: mdadm array degraded
288         expr: sum (node_md_disks{state="active"}) without (state) < node_md_disks_required
289         for: 0m
290         labels:
291           alertgroup: "{{ $labels.instance }}"
292         annotations:
293           required: "{{ with printf \"node_md_disks_required{instance='%s',device='%s'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
294           active: "{{ with printf \"node_md_disks{instance='%s',device='%s',state='active'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
295           failed: "{{ with printf \"node_md_disks{instance='%s',device='%s',state='failed'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
296           spare: "{{ with printf \"node_md_disks{instance='%s',device='%s',state='spare'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
297       - alert: mdadm disk failed
298         expr: node_md_disks{state="failed"} > 0
299         for: 0m
300         labels:
301           alertgroup: "{{ $labels.instance }}"
302         annotations:
303           required: "{{ with printf \"node_md_disks_required{instance='%s',device='%s'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
304           active: "{{ with printf \"node_md_disks{instance='%s',device='%s',state='active'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
305           failed: "{{ with printf \"node_md_disks{instance='%s',device='%s',state='failed'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
306           spare: "{{ with printf \"node_md_disks{instance='%s',device='%s',state='spare'}\" $labels.instance $labels.device | query }}{{ . | first | value | humanize }} disks{{end}}"
307   - name: memory
308     rules:
309       - alert: low memory
310         expr: node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes < 0.1
311         for: 15m
312         labels:
313           alertgroup: "{{ $labels.instance }}"
314         annotations:
315           memory_free: "{{ $value | humanizePercentage }}"
316       - alert: memory pressure
317         expr: rate(node_pressure_memory_waiting_seconds_total[5m]) > 0.6
318         for: 60m
319         labels:
320           alertgroup: "{{ $labels.instance }}"
321         annotations:
322           pressure: "{{ $value | humanizePercentage }}"
323       - alert: oom kill detected
324         expr: increase(node_vmstat_oom_kill[1m]) > 0
325         for: 0m
326         labels:
327           alertgroup: "{{ $labels.instance }}"
328         annotations:
329           new_oom_kills: "{{ $value }}"
330   - name: network
331     rules:
332       - alert: interface transmit rate
333         expr: rate(node_network_transmit_bytes_total[1m]) / node_network_speed_bytes > 0.98
334         for: 5m
335         labels:
336           alertgroup: "{{ $labels.instance }}"
337         annotations:
338           bandwidth_used: "{{ $value | humanizePercentage }}"
339       - alert: interface receive rate
340         expr: rate(node_network_receive_bytes_total[1m]) / node_network_speed_bytes > 0.98
341         for: 5m
342         labels:
343           alertgroup: "{{ $labels.instance }}"
344         annotations:
345           bandwidth_used: "{{ $value | humanizePercentage }}"
346       - alert: interface transmit errors
347         expr: rate(node_network_transmit_errs_total{device!~"wg.*"}[1m]) / rate(node_network_transmit_packets_total{device!~"wg.*"}[1m]) > 0.01
348         for: 5m
349         labels:
350           alertgroup: "{{ $labels.instance }}"
351         annotations:
352           error_rate: "{{ $value | humanizePercentage }}"
353       - alert: wireguard interface transmit errors
354         expr: rate(node_network_transmit_errs_total{device=~"wg.*"}[1m]) / rate(node_network_transmit_packets_total{device=~"wg.*"}[1m]) > 0.05
355         for: 1h
356         labels:
357           alertgroup: "{{ $labels.instance }}"
358         annotations:
359           error_rate: "{{ $value | humanizePercentage }}"
360       - alert: interface receive errors
361         expr: rate(node_network_receive_errs_total[1m]) / rate(node_network_receive_packets_total[1m]) > 0.01
362         for: 5m
363         labels:
364           alertgroup: "{{ $labels.instance }}"
365         annotations:
366           error_rate: "{{ $value | humanizePercentage }}"
367       - alert: conntrack entries
368         expr: node_nf_conntrack_entries / node_nf_conntrack_entries_limit > 0.8
369         for: 5m
370         labels:
371           alertgroup: "{{ $labels.instance }}"
372         annotations:
373           entries_used: "{{ $value | humanizePercentage }}"
374   - name: nominatim
375     rules:
376       - alert: nominatim replication delay
377         expr: nominatim_replication_delay > 10800
378         for: 1h
379         labels:
380           alertgroup: nominatim
381         annotations:
382           delay: "{{ $value | humanizeDuration }}"
383   - name: overpass
384     rules:
385       - alert: overpass osm database age
386         expr: overpass_database_age_seconds{database="osm"} > 1800
387         for: 5m
388         labels:
389           alertgroup: overpass
390         annotations:
391           age: "{{ $value | humanizeDuration }}"
392       - alert: overpass area database age
393         expr: overpass_database_age_seconds{database="area"} > 86400
394         for: 1h
395         labels:
396           alertgroup: overpass
397         annotations:
398           age: "{{ $value | humanizeDuration }}"
399   - name: planet
400     rules:
401       - alert: planet dump overdue
402         expr: time() - file_stat_modif_time_seconds{path=~"/store/planet/(pbf|planet)/.*"} > 7 * 86400 and ignoring (job, name, path) chef_role{name="planetdump"} == 1
403         for: 24h
404         labels:
405           alertgroup: planet
406         annotations:
407           overdue_by: "{{ $value | humanizeDuration }}"
408       - alert: notes dump overdue
409         expr: time() - file_stat_modif_time_seconds{path=~"/store/planet/notes/.*"} > 86400 and ignoring (job, name, path) chef_role{name="planetdump"} == 1
410         for: 6h
411         labels:
412           alertgroup: planet
413         annotations:
414           overdue_by: "{{ $value | humanizeDuration }}"
415       - alert: daily replication feed delayed
416         expr: time() - file_stat_modif_time_seconds{path=~"/store/planet/replication/day/.*"} > 86400 and ignoring (job, name, path) chef_role{name="planetdump"} == 1
417         for: 3h
418         labels:
419           alertgroup: planet
420         annotations:
421           delayed_by: "{{ $value | humanizeDuration }}"
422       - alert: hourly replication feed delayed
423         expr: time() - file_stat_modif_time_seconds{path=~"/store/planet/replication/hour/.*"} > 3600 and ignoring (job, name, path) chef_role{name="planetdump"} == 1
424         for: 30m
425         labels:
426           alertgroup: planet
427         annotations:
428           delayed_by: "{{ $value | humanizeDuration }}"
429       - alert: minutely replication feed delayed
430         expr: time() - file_stat_modif_time_seconds{path=~"/store/planet/replication/minute/.*"} > 60 and ignoring (job, name, path) chef_role{name="planetdump"} == 1
431         for: 5m
432         labels:
433           alertgroup: planet
434         annotations:
435           delayed_by: "{{ $value | humanizeDuration }}"
436       - alert: changeset replication feed delayed
437         expr: time() - file_stat_modif_time_seconds{path=~"/store/planet/replication/changesets/.*"} > 60 and ignoring (job, name, path) chef_role{name="planetdump"} == 1
438         for: 5m
439         labels:
440           alertgroup: planet
441         annotations:
442           delayed_by: "{{ $value | humanizeDuration }}"
443   - name: postgresql
444     rules:
445       - alert: postgresql down
446         expr: pg_up == 0
447         for: 1m
448         labels:
449           alertgroup: "{{ $labels.instance }}"
450       - alert: postgresql replication delay
451         expr: pg_replication_lag_seconds > 5
452         for: 1m
453         labels:
454           alertgroup: "{{ $labels.instance }}"
455         annotations:
456           delay: "{{ $value | humanizeDuration }}"
457       - alert: postgresql connection limit
458         expr: sum (pg_stat_activity_count) by (instance, server) / sum (pg_settings_max_connections) by (instance, server) > 0.8
459         for: 1m
460         labels:
461           alertgroup: "{{ $labels.instance }}"
462         annotations:
463           connections_used: "{{ $value | humanizePercentage }}"
464       - alert: postgresql deadlocks
465         expr: increase(pg_stat_database_deadlocks{datname!="nominatim"}[1m]) > 5
466         for: 0m
467         labels:
468           alertgroup: "{{ $labels.instance }}"
469         annotations:
470           new_deadlocks: "{{ $value }}"
471       - alert: postgresql slow queries
472         expr: pg_slow_queries > 0
473         for: 5m
474         labels:
475           alertgroup: "{{ $labels.instance }}"
476         annotations:
477           queries: "{{ $value }}"
478   - name: prometheus
479     rules:
480       - alert: prometheus configuration error
481         expr: prometheus_config_last_reload_successful == 0
482         for: 10m
483         labels:
484           alertgroup: "prometheus"
485       - alert: prometheus target missing
486         expr: up == 0
487         for: 10m
488         labels:
489           alertgroup: "prometheus"
490   - name: raid
491     rules:
492       - alert: raid array degraded
493         expr: ohai_array_info{status="degraded"} > 0
494         for: 5m
495         labels:
496           alertgroup: "{{ $labels.instance }}"
497       - alert: raid disk failed
498         expr: ohai_disk_info{status="failed"} > 0
499         for: 5m
500         labels:
501           alertgroup: "{{ $labels.instance }}"
502   - name: rasdaemon
503     rules:
504       - alert: memory controller errors
505         expr: increase(rasdaemon_mc_events_total[1m]) > 0
506         for: 0m
507         labels:
508           alertgroup: "{{ $labels.instance }}"
509         annotations:
510           new_errors: "{{ $value }}"
511       - alert: pcie aer errors
512         expr: increase(rasdaemon_aer_events_total[1m]) > 0
513         for: 0m
514         labels:
515           alertgroup: "{{ $labels.instance }}"
516         annotations:
517           new_ercrors: "{{ $value }}"
518   - name: smart
519     rules:
520       - alert: smart failure
521         expr: smart_health_status == 0
522         for: 60m
523         labels:
524           alertgroup: "{{ $labels.instance }}"
525       - alert: smart ssd wearout approaching
526         expr: smart_percentage_used >= 80
527         for: 60m
528         labels:
529           alertgroup: "{{ $labels.instance }}"
530         annotations:
531           percentage_used: "{{ $value | humanizePercentage }}"
532   - name: ssl
533     rules:
534       - alert: ssl certificate probe failed
535         expr: ssl_probe_success == 0
536         for: 60m
537         labels:
538           alertgroup: ssl
539       - alert: ssl certificate expiry
540         expr: ssl_verified_cert_not_after{chain_no="0"} - time() < 86400 * 14
541         for: 0m
542         labels:
543           alertgroup: ssl
544         annotations:
545           expires_in: "{{ $value | humanizeDuration }}"
546       - alert: ssl certificate revoked
547         expr: ssl_ocsp_response_status == 1
548         for: 0m
549         labels:
550           alertgroup: ssl
551       - alert: ocsp status unknown
552         expr: ssl_ocsp_response_status == 1
553         for: 0m
554         labels:
555           alertgroup: ssl
556   - name: statuscake
557     rules:
558       - alert: statuscake uptime check failing
559         expr: statuscake_uptime{status="down",paused="false"} > 0
560         for: 10m
561         labels:
562           alertgroup: statuscake
563   - name: systemd
564     rules:
565       - alert: systemd failed service
566         expr: node_systemd_unit_state{state="failed",name!="chef-client.service"} == 1
567         for: 5m
568         labels:
569           alertgroup: "{{ $labels.instance }}"
570       - alert: systemd failed chef client service
571         expr: node_systemd_unit_state{state="failed",name="chef-client.service"} == 1
572         for: 6h
573         labels:
574           alertgroup: "{{ $labels.instance }}"
575   - name: tile
576     rules:
577       - alert: renderd replication delay
578         expr: renderd_replication_delay > 120
579         for: 15m
580         labels:
581           alertgroup: tile
582         annotations:
583           delay: "{{ $value | humanizeDuration }}"
584       - alert: missed tile rate
585         expr: sum(rate(modtile_http_response_total{code="404"}[5m])) by (instance) / sum(rate(modtile_http_response_total[5m])) by (instance) > 0.05
586         for: 5m
587         labels:
588           alertgroup: tile
589         annotations:
590           miss_rate: "{{ $value | humanizePercentage }}"
591   - name: time
592     rules:
593       - alert: clock not synchronising
594         expr: min_over_time(node_timex_sync_status[1m]) == 0 and node_timex_maxerror_seconds >= 16
595         for: 5m
596         labels:
597           alertgroup: "{{ $labels.instance }}"
598       - alert: clock skew detected
599         expr: (node_timex_offset_seconds > 0.05 and deriv(node_timex_offset_seconds[5m]) >= 0) or (node_timex_offset_seconds < -0.05 and deriv(node_timex_offset_seconds[5m]) <= 0)
600         for: 5m
601         labels:
602           alertgroup: "{{ $labels.instance }}"
603         annotations:
604           skew: "{{ with printf \"node_timex_offset_seconds{instance='%s'}\" $labels.instance | query }} {{ . | humanizeDuration }}{{ end }}"
605   - name: web
606     rules:
607       - alert: web error rate
608         expr: sum(rate(api_call_count_total{status=~"50[0-8]|5[1-9][0-9]"}[5m])) by (instance) / sum(rate(api_call_count_total[5m])) by (instance) > 0.002
609         for: 5m
610         labels:
611           alertgroup: web
612         annotations:
613           error_rate: "{{ $value | humanizePercentage }}"
614       - alert: job processing rate
615         expr: rate(pg_stat_user_tables_n_tup_del{datname="openstreetmap",relname="delayed_jobs"}[5m]) / rate(pg_stat_user_tables_n_tup_ins{datname="openstreetmap",relname="delayed_jobs"}[5m]) < 0.9 and ignoring(job, name, datname, relname, schemaname, server) chef_role{name="db-master"} == 1
616         for: 15m
617         labels:
618           alertgroup: web
619         annotations:
620           job_processing_rate: "{{ $value | humanizePercentage }}"