File tree Expand file tree Collapse file tree 2 files changed +21
-13
lines changed
Expand file tree Collapse file tree 2 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,18 @@ In this example we again customize the text sent to our Slack receiver accessing
3333Alert
3434
3535```
36- ALERT InstanceDown
37- IF up == 0
38- FOR 5m
39- LABELS { severity = "page" }
40- ANNOTATIONS {
36+ groups:
37+ - name: Instances
38+ rules:
39+ - alert: InstanceDown
40+ expr: up == 0
41+ for: 5m
42+ labels:
43+ severity: page
4144 # Prometheus templates apply here in the annotation and label fields of the alert.
42- summary = "Instance {{ $labels.instance }} down",
43- description = " {{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes."
44- }
45+ annotations:
46+ description: ' {{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.'
47+ summary: Instance {{ $labels.instance }} down
4548```
4649
4750Receiver
Original file line number Diff line number Diff line change @@ -82,9 +82,14 @@ Set up an alert to fire if the job has not run recently. Add the following to
8282the rules of a Prometheus server that is scraping the Pushgateway:
8383
8484```
85- ALERT MyBatchJobNotCompleted
86- IF min(time() - my_batch_job_last_success_unixtime{job="my_batch_job"}) > 60 * 60
87- FOR 5m
88- WITH { severity="page" }
89- SUMMARY "MyBatchJob has not completed successfully in over an hour"
85+ groups:
86+ - name: MyBatchJob
87+ rules:
88+ - alert: MyBatchJobNotCompleted
89+ expr: min(time() - my_batch_job_last_success_unixtime{job="my_batch_job"}) > 60 * 60
90+ for: 5m
91+ labels:
92+ severity: page
93+ annotations:
94+ summary: MyBatchJob has not completed successfully in over an hour
9095```
You can’t perform that action at this time.
0 commit comments