forked from slok/sloth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getting-started.yml
241 lines (239 loc) · 9.11 KB
/
getting-started.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
---
# Code generated by Sloth (dev): https://github.com/slok/sloth.
# DO NOT EDIT.
groups:
- name: sloth-slo-sli-recordings-myservice-requests-availability
rules:
- record: slo:sli_error:ratio_rate5m
expr: |
(sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[5m])))
/
(sum(rate(http_request_duration_seconds_count{job="myservice"}[5m])))
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
sloth_window: 5m
tier: "2"
- record: slo:sli_error:ratio_rate30m
expr: |
(sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[30m])))
/
(sum(rate(http_request_duration_seconds_count{job="myservice"}[30m])))
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
sloth_window: 30m
tier: "2"
- record: slo:sli_error:ratio_rate1h
expr: |
(sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[1h])))
/
(sum(rate(http_request_duration_seconds_count{job="myservice"}[1h])))
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
sloth_window: 1h
tier: "2"
- record: slo:sli_error:ratio_rate2h
expr: |
(sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[2h])))
/
(sum(rate(http_request_duration_seconds_count{job="myservice"}[2h])))
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
sloth_window: 2h
tier: "2"
- record: slo:sli_error:ratio_rate6h
expr: |
(sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[6h])))
/
(sum(rate(http_request_duration_seconds_count{job="myservice"}[6h])))
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
sloth_window: 6h
tier: "2"
- record: slo:sli_error:ratio_rate1d
expr: |
(sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[1d])))
/
(sum(rate(http_request_duration_seconds_count{job="myservice"}[1d])))
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
sloth_window: 1d
tier: "2"
- record: slo:sli_error:ratio_rate3d
expr: |
(sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[3d])))
/
(sum(rate(http_request_duration_seconds_count{job="myservice"}[3d])))
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
sloth_window: 3d
tier: "2"
- record: slo:sli_error:ratio_rate30d
expr: |
sum_over_time(slo:sli_error:ratio_rate5m{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"}[30d])
/ ignoring (sloth_window)
count_over_time(slo:sli_error:ratio_rate5m{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"}[30d])
labels:
sloth_window: 30d
- name: sloth-slo-meta-recordings-myservice-requests-availability
rules:
- record: slo:objective:ratio
expr: vector(0.9990000000000001)
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
tier: "2"
- record: slo:error_budget:ratio
expr: vector(1-0.9990000000000001)
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
tier: "2"
- record: slo:time_period:days
expr: vector(30)
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
tier: "2"
- record: slo:current_burn_rate:ratio
expr: |
slo:sli_error:ratio_rate5m{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"}
/ on(sloth_id, sloth_slo, sloth_service) group_left
slo:error_budget:ratio{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"}
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
tier: "2"
- record: slo:period_burn_rate:ratio
expr: |
slo:sli_error:ratio_rate30d{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"}
/ on(sloth_id, sloth_slo, sloth_service) group_left
slo:error_budget:ratio{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"}
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
tier: "2"
- record: slo:period_error_budget_remaining:ratio
expr: 1 - slo:period_burn_rate:ratio{sloth_id="myservice-requests-availability",
sloth_service="myservice", sloth_slo="requests-availability"}
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_service: myservice
sloth_slo: requests-availability
tier: "2"
- record: sloth_slo_info
expr: vector(1)
labels:
cmd: examplesgen.sh
owner: myteam
repo: myorg/myservice
sloth_id: myservice-requests-availability
sloth_mode: cli-gen-prom
sloth_service: myservice
sloth_slo: requests-availability
sloth_spec: prometheus/v1
sloth_version: dev
tier: "2"
- name: sloth-slo-alerts-myservice-requests-availability
rules:
- alert: MyServiceHighErrorRate
expr: |
(
(slo:sli_error:ratio_rate5m{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"} > (14.4 * 0.0009999999999999432))
and ignoring (sloth_window)
(slo:sli_error:ratio_rate1h{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"} > (14.4 * 0.0009999999999999432))
)
or ignoring (sloth_window)
(
(slo:sli_error:ratio_rate30m{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"} > (6 * 0.0009999999999999432))
and ignoring (sloth_window)
(slo:sli_error:ratio_rate6h{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"} > (6 * 0.0009999999999999432))
)
labels:
category: availability
routing_key: myteam
severity: pageteam
sloth_severity: page
annotations:
summary: High error rate on 'myservice' requests responses
title: (page) {{$labels.sloth_service}} {{$labels.sloth_slo}} SLO error budget
burn rate is too fast.
- alert: MyServiceHighErrorRate
expr: |
(
(slo:sli_error:ratio_rate2h{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"} > (3 * 0.0009999999999999432))
and ignoring (sloth_window)
(slo:sli_error:ratio_rate1d{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"} > (3 * 0.0009999999999999432))
)
or ignoring (sloth_window)
(
(slo:sli_error:ratio_rate6h{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"} > (1 * 0.0009999999999999432))
and ignoring (sloth_window)
(slo:sli_error:ratio_rate3d{sloth_id="myservice-requests-availability", sloth_service="myservice", sloth_slo="requests-availability"} > (1 * 0.0009999999999999432))
)
labels:
category: availability
severity: slack
slack_channel: '#alerts-myteam'
sloth_severity: ticket
annotations:
summary: High error rate on 'myservice' requests responses
title: (ticket) {{$labels.sloth_service}} {{$labels.sloth_slo}} SLO error budget
burn rate is too fast.