-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprometheus_alerts.yaml
90 lines (90 loc) · 3.25 KB
/
prometheus_alerts.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
"groups":
- "name": "django"
"rules":
- "alert": "DjangoMigrationsUnapplied"
"annotations":
"dashboard_url": "https://grafana.com/d/django-overview-jkwq/django-overview?var-namespace={{ $labels.namespace }}&var-job={{ $labels.job }}"
"description": "The job {{ $labels.job }} has unapplied migrations."
"summary": "Django has unapplied migrations."
"expr": |
sum(
django_migrations_unapplied_total{
job=~"django"
}
) by (namespace, job)
> 0
"for": "15m"
"labels":
"severity": "warning"
- "alert": "DjangoDatabaseException"
"annotations":
"dashboard_url": "https://grafana.com/d/django-overview-jkwq/django-overview?var-namespace={{ $labels.namespace }}&var-job={{ $labels.job }}"
"description": "The job {{ $labels.job }} has hit the database exception {{ $labels.type }}."
"summary": "Django database exception."
"expr": |
sum (
increase(
django_db_errors_total{
job=~"django"
}[10m]
)
) by (type, namespace, job)
> 0
"labels":
"severity": "info"
- "alert": "DjangoHighHttp4xxErrorRate"
"annotations":
"dashboard_url": "https://grafana.com/d/django-requests-by-view-jkwq/django-requests-by-view?var-namespace={{ $labels.namespace }}&var-job={{ $labels.job }}&var-view={{ $labels.view }}"
"description": "More than 5% HTTP requests with status 4xx for {{ $labels.job }}/{{ $labels.view }} the past 5m."
"summary": "Django high HTTP 4xx error rate."
"expr": |
sum(
rate(
django_http_responses_total_by_status_view_method_total{
job=~"django",
status=~"^4.*",
view!~"<unnamed view>|health_check:health_check_home|prometheus-django-metrics"
}[5m]
)
) by (namespace, job, view)
/
sum(
rate(
django_http_responses_total_by_status_view_method_total{
job=~"django",
view!~"<unnamed view>|health_check:health_check_home|prometheus-django-metrics"
}[5m]
)
) by (namespace, job, view)
* 100 > 5
"for": "1m"
"labels":
"severity": "warning"
- "alert": "DjangoHighHttp5xxErrorRate"
"annotations":
"dashboard_url": "https://grafana.com/d/django-requests-by-view-jkwq/django-requests-by-view?var-namespace={{ $labels.namespace }}&var-job={{ $labels.job }}&var-view={{ $labels.view }}"
"description": "More than 5% HTTP requests with status 5xx for {{ $labels.job }}/{{ $labels.view }} the past 5m."
"summary": "Django high HTTP 5xx error rate."
"expr": |
sum(
rate(
django_http_responses_total_by_status_view_method_total{
job=~"django",
status=~"^5.*",
view!~"<unnamed view>|health_check:health_check_home|prometheus-django-metrics"
}[5m]
)
) by (namespace, job, view)
/
sum(
rate(
django_http_responses_total_by_status_view_method_total{
job=~"django",
view!~"<unnamed view>|health_check:health_check_home|prometheus-django-metrics"
}[5m]
)
) by (namespace, job, view)
* 100 > 5
"for": "1m"
"labels":
"severity": "warning"