2020-06-15 08:03:07 -07:00
|
|
|
rule_files:
|
|
|
|
- alerts.yml
|
|
|
|
|
|
|
|
evaluation_interval: 1m
|
|
|
|
|
|
|
|
tests:
|
|
|
|
- interval: 1m
|
|
|
|
input_series:
|
|
|
|
- series: 'up{job="prometheus", instance="localhost:9090"}'
|
|
|
|
values: "0+0x1440"
|
2020-09-21 09:15:34 -07:00
|
|
|
|
|
|
|
promql_expr_test:
|
|
|
|
- expr: count(ALERTS) by (alertname, alertstate)
|
|
|
|
eval_time: 4m
|
|
|
|
exp_samples:
|
|
|
|
- labels: '{alertname="InstanceDown",alertstate="pending"}'
|
|
|
|
value: 1
|
|
|
|
|
2020-06-15 08:03:07 -07:00
|
|
|
alert_rule_test:
|
|
|
|
- eval_time: 1d
|
|
|
|
alertname: InstanceDown
|
|
|
|
exp_alerts:
|
|
|
|
- exp_labels:
|
|
|
|
severity: page
|
|
|
|
instance: localhost:9090
|
|
|
|
job: prometheus
|
|
|
|
exp_annotations:
|
|
|
|
summary: "Instance localhost:9090 down"
|
|
|
|
description: "localhost:9090 of job prometheus has been down for more than 5 minutes."
|