-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path5xx-rate.tmpl
More file actions
50 lines (50 loc) · 1.31 KB
/
5xx-rate.tmpl
File metadata and controls
50 lines (50 loc) · 1.31 KB
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
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{.Namespace}}-{{.Name}}-5xx-rate
namespace: {{.Namespace}}
labels:
role: alert-rules
spec:
groups:
- name: {{.Namespace}}-{{.Name}}-5xx-rate.rules
rules:
- alert: {{.Name}}-5xx-rate
annotations:
summary: |
{{.Identifier}}: 5xx proportion above {{.Threshold}} for 1m
expr: |
(
sum(
rate(
nginx_ingress_controller_requests{exported_namespace="{{.Namespace}}",ingress="{{.Name}}",status=~"5.."}[30s]
)
)
/
sum(
rate(
nginx_ingress_controller_requests{exported_namespace="{{.Namespace}}",ingress="{{.Name}}"}[30s]
)
)
) > {{.Threshold}}
for: 1m
labels:
identifier: {{.Identifier}}
name: {{.Name}}-5xx-rate
namespace: {{.Namespace}}
{{if .Owner}}
owner: {{.Owner}}
{{end}}
{{if .Environment}}
environment: {{.Environment}}
{{end}}
{{if .Criticality}}
criticality: {{.Criticality}}
{{end}}
{{if .Sensitivity}}
sensitivity: {{.Sensitivity}}
{{end}}
{{range $key, $value := .CustomLabels}}
{{$key}}: {{$value}}
{{end}}