Mercurial > code > home > repos > victoriametrics
comparison alert_rules.py @ 36:2bc188c4117a
rules updates, incl front door group
author | drewp@bigasterisk.com |
---|---|
date | Sun, 15 Oct 2023 18:34:29 -0700 |
parents | 3b91d52b007d |
children | 6e27d280b598 |
comparison
equal
deleted
inserted
replaced
35:80e275ab2f88 | 36:2bc188c4117a |
---|---|
16 # from https://awesome-prometheus-alerts.grep.to/rules.html | 16 # from https://awesome-prometheus-alerts.grep.to/rules.html |
17 return [ | 17 return [ |
18 { | 18 { |
19 "alert": "metricsTargetMissing", | 19 "alert": "metricsTargetMissing", |
20 "expr": 'up{job!~"cm-acme-.*"} == 0', | 20 "expr": 'up{job!~"cm-acme-.*"} == 0', |
21 'for': '10m', | |
21 "labels": { | 22 "labels": { |
22 "severity": "critical" | 23 "severity": "critical" |
23 }, | 24 }, |
24 "annotations": { | 25 "annotations": { |
25 "summary": "metrics target missing (instance {{ $labels.instance }})", | 26 "summary": "metrics target missing (instance {{ $labels.instance }})", |
167 }, | 168 }, |
168 }, | 169 }, |
169 ], | 170 ], |
170 }, | 171 }, |
171 { | 172 { |
172 "name": "disk_errs", | 173 "name": |
173 "interval": "2d", | 174 "disk_errs", |
175 "interval": | |
176 "2d", | |
174 "rules": [{ | 177 "rules": [{ |
178 "alert": "zpool_device_error_increase", | |
179 "labels": { | |
180 "severity": "warning" | |
181 }, | |
182 "expr": 'increase(zpool_device_error_count[3d]) > 0', | |
183 }, { | |
175 "alert": "zpool_device_error_count", | 184 "alert": "zpool_device_error_count", |
176 "labels": { | 185 "labels": { |
177 "severity": "warning" | 186 "severity": "warning" |
178 }, | 187 }, |
179 "expr": 'increase(zpool_device_error_count[3d]) > 0', | 188 "expr": 'zpool_device_error_count > 0', |
180 }], | 189 }], |
181 }, | 190 }, |
182 { | 191 { |
183 "name": | 192 "name": |
184 "front_door", | 193 "front_door", |
185 "interval": | 194 "interval": |
186 "5m", | 195 "5m", |
187 "rules": [ | 196 "rules": [ |
188 { | 197 { |
189 "alert": "service_disconnected_from_mqtt", | 198 "alert": "front_door_reader_esp32_no_mqtt", |
190 "expr": "mqtt_connected < 1" | 199 'expr': 'hw_connected{job="fingerprint"} < 1', |
191 }, | 200 "annotations": { |
192 { | 201 "summary": "see https://bigasterisk.com/front-door-lock/" |
193 "alert": "esp_not_connected_to_mqtt", | 202 }, |
194 "expr": "hw_connected < 1", | 203 }, |
195 }, | 204 { |
196 ] | 205 "alert": "fronr_door_reader_svc_down", |
206 'expr': 'up{job="fingerprint"} < 1', | |
207 "annotations": { | |
208 "summary": "see https://bigasterisk.com/front-door-lock/" | |
209 }, | |
210 }, | |
211 { | |
212 "alert": "fronr_door_reader_svc_reader_no_mqtt", | |
213 'expr': 'mqtt_connected{job="fingerprint"} < 1', | |
214 "annotations": { | |
215 "summary": "see https://bigasterisk.com/front-door-lock/" | |
216 }, | |
217 }, | |
218 { | |
219 "alert": "front_door_lock_svc_down", | |
220 'expr': 'up{job="front-door-lock"} < 1', | |
221 "annotations": { | |
222 "summary": "see https://bigasterisk.com/front-door-lock/" | |
223 }, | |
224 }, | |
225 { | |
226 "alert": "front_door_lock_svc_no_mqtt", | |
227 'expr': 'mqtt_connected{job="front-door-lock"} < 1', | |
228 "annotations": { | |
229 "summary": "see https://bigasterisk.com/front-door-lock/" | |
230 }, | |
231 }, | |
232 { | |
233 "alert": "front_door_lock_esp32_no_mqtt", | |
234 'expr': 'hw_connected{job="front-door-lock"} < 1', | |
235 "annotations": { | |
236 "summary": "see https://bigasterisk.com/front-door-lock/" | |
237 }, | |
238 }, | |
239 ], | |
197 }, | 240 }, |
198 { | 241 { |
199 "name": | 242 "name": |
200 "alerts", | 243 "alerts", |
201 "rules": [ | 244 "rules": [ |