forked from cablespaghetti/k3s-monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
traefik-prometheusrule.yaml
40 lines (39 loc) · 2.03 KB
/
traefik-prometheusrule.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
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
app: kube-prometheus-stack
release: prometheus
name: traefik
spec:
groups:
- name: traefik
rules:
- alert: test.cablespaghetti.dev-IngressHigh5xxRate
annotations:
message: The percentage of 5xx errors for test.cablespaghetti.dev over the last 5 minutes is over 1%.
expr: (sum(rate(traefik_backend_request_duration_seconds_count{backend="test.cablespaghetti.dev/",code=~"5[0-9]{2}"}[1m]))/sum(rate(traefik_backend_request_duration_seconds_count{backend="test.cablespaghetti.dev/"}[1m])))*100 > 1
for: 5m
labels:
severity: warning
- alert: test.cablespaghetti.dev-IngressHigh5xxRate
annotations:
message: The percentage of 5xx errors for test.cablespaghetti.dev over the last 1 minute is over 5%.
expr: (sum(rate(traefik_backend_request_duration_seconds_count{backend="test.cablespaghetti.dev/",code=~"5[0-9]{2}"}[1m]))/sum(rate(traefik_backend_request_duration_seconds_count{backend="test.cablespaghetti.dev/"}[1m])))*100 > 5
for: 1m
labels:
severity: critical
- alert: test.cablespaghetti.dev-IngressHighLatency
annotations:
message: The average latency of test.cablespaghetti.dev over the last 5 minutes is over 1s.
expr: sum(rate(traefik_backend_request_duration_seconds_sum{backend="test.cablespaghetti.dev/"}[1m]))/sum(rate(traefik_backend_request_duration_seconds_count{backend="test.cablespaghetti.dev/"}[1m])) > 1
for: 5m
labels:
severity: warning
- alert: test.cablespaghetti.dev-IngressHighLatency
annotations:
message: The average latency of test.cablespaghetti.dev over the last 5 minutes is over 5s.
expr: sum(rate(traefik_backend_request_duration_seconds_sum{backend="test.cablespaghetti.dev/"}[1m]))/sum(rate(traefik_backend_request_duration_seconds_count{backend="test.cablespaghetti.dev/"}[1m])) > 5
for: 5m
labels:
severity: critical