-
Notifications
You must be signed in to change notification settings - Fork 2
/
tests.yaml
76 lines (75 loc) · 3.32 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# yamllint disable rule:line-length
rule_files:
- prometheus_alerts.yaml
tests:
- interval: 5m
input_series:
- series: 'django_migrations_unapplied_total{namespace="django", job="django"}'
values: '1+0x4'
alert_rule_test:
- eval_time: 20m
alertname: DjangoMigrationsUnapplied
exp_alerts:
- exp_labels:
namespace: django
job: django
severity: warning
exp_annotations:
summary: 'Django has unapplied migrations.'
description: 'The job django has unapplied migrations.'
dashboard_url: 'https://grafana.com/d/django-overview-jkwq/django-overview?var-namespace=django&var-job=django'
- interval: 1m
input_series:
- series: 'django_db_errors_total{namespace="django", job="django", type="IntegrityError"}'
values: '1+1x20'
alert_rule_test:
- eval_time: 15m
alertname: DjangoDatabaseException
exp_alerts:
- exp_labels:
namespace: django
job: django
severity: info
type: IntegrityError
exp_annotations:
summary: 'Django database exception.'
description: 'The job django has hit the database exception IntegrityError.'
dashboard_url: 'https://grafana.com/d/django-overview-jkwq/django-overview?var-namespace=django&var-job=django'
- interval: 1m
input_series:
- series: 'django_http_responses_total_by_status_view_method_total{namespace="django", job="django", view="alert-test", status="200"}'
values: '1+10x10'
- series: 'django_http_responses_total_by_status_view_method_total{namespace="django", job="django", view="alert-test", status="403"}'
values: '1+1x10'
alert_rule_test:
- eval_time: 10m
alertname: DjangoHighHttp4xxErrorRate
exp_alerts:
- exp_labels:
namespace: django
job: django
severity: warning
view: alert-test
exp_annotations:
summary: 'Django high HTTP 4xx error rate.'
description: 'More than 5% HTTP requests with status 4xx for django/alert-test the past 5m.'
dashboard_url: 'https://grafana.com/d/django-requests-by-view-jkwq/django-requests-by-view?var-namespace=django&var-job=django&var-view=alert-test'
- interval: 1m
input_series:
- series: 'django_http_responses_total_by_status_view_method_total{namespace="django", job="django", view="alert-test", status="200"}'
values: '1+10x10'
- series: 'django_http_responses_total_by_status_view_method_total{namespace="django", job="django", view="alert-test", status="503"}'
values: '1+1x10'
alert_rule_test:
- eval_time: 10m
alertname: DjangoHighHttp5xxErrorRate
exp_alerts:
- exp_labels:
namespace: django
job: django
severity: warning
view: alert-test
exp_annotations:
summary: 'Django high HTTP 5xx error rate.'
description: 'More than 5% HTTP requests with status 5xx for django/alert-test the past 5m.'
dashboard_url: 'https://grafana.com/d/django-requests-by-view-jkwq/django-requests-by-view?var-namespace=django&var-job=django&var-view=alert-test'