Repository navigation
Expand file tree
/
Copy pathalert-rules.yml
More file actions
262 lines (245 loc) · 9.79 KB
/
Copy pathalert-rules.yml
File metadata and controls
262 lines (245 loc) · 9.79 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
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
groups:
- name: backend-availability
rules:
- alert: BackendDown
expr: up{job="backend"} == 0
for: 1m
labels:
severity: critical
team: backend
annotations:
summary: "Backend instance {{ $labels.instance }} is down"
description: "Backend target {{ $labels.instance }} (job {{ $labels.job }}) has been unreachable for more than 1 minute."
runbook_url: "https://docs.example.com/runbooks/backend-down"
- alert: BackendTargetMissing
expr: absent(up{job="backend"})
for: 5m
labels:
severity: critical
team: backend
annotations:
summary: "No backend targets are being scraped"
description: "Prometheus has not scraped any backend targets for more than 5 minutes. The service may be removed from service discovery."
runbook_url: "https://docs.example.com/runbooks/backend-down"
- name: http-errors
rules:
- alert: HighHttp5xxErrorRate
expr: |
(
sum(rate(http_requests_total{job="backend", status=~"5.."}[5m]))
/
sum(rate(http_requests_total{job="backend"}[5m]))
) > 0.05
for: 5m
labels:
severity: critical
team: backend
annotations:
summary: "High HTTP 5xx error rate ({{ $value | humanizePercentage }})"
description: "More than 5% of backend HTTP requests have returned 5xx responses over the last 5 minutes."
runbook_url: "https://docs.example.com/runbooks/http-5xx"
- alert: ElevatedHttp5xxErrorRate
expr: |
(
sum(rate(http_requests_total{job="backend", status=~"5.."}[5m]))
/
sum(rate(http_requests_total{job="backend"}[5m]))
) > 0.01
for: 10m
labels:
severity: warning
team: backend
annotations:
summary: "Elevated HTTP 5xx error rate ({{ $value | humanizePercentage }})"
description: "More than 1% of backend HTTP requests have returned 5xx responses over the last 10 minutes."
runbook_url: "https://docs.example.com/runbooks/http-5xx"
- alert: HighHttp4xxErrorRate
expr: |
(
sum(rate(http_requests_total{job="backend", status=~"4.."}[5m]))
/
sum(rate(http_requests_total{job="backend"}[5m]))
) > 0.25
for: 15m
labels:
severity: warning
team: backend
annotations:
summary: "High HTTP 4xx error rate ({{ $value | humanizePercentage }})"
description: "More than 25% of backend HTTP requests have returned 4xx responses over the last 15 minutes."
runbook_url: "https://docs.example.com/runbooks/http-4xx"
- name: http-latency
rules:
- alert: HighHttpLatencyP95
expr: |
histogram_quantile(
0.95,
sum(rate(http_request_duration_seconds_bucket{job="backend"}[5m])) by (le)
) > 1
for: 10m
labels:
severity: warning
team: backend
annotations:
summary: "High HTTP p95 latency ({{ $value | humanizeDuration }})"
description: "The 95th percentile backend HTTP request latency has exceeded 1s for more than 10 minutes."
runbook_url: "https://docs.example.com/runbooks/http-latency"
- alert: CriticalHttpLatencyP99
expr: |
histogram_quantile(
0.99,
sum(rate(http_request_duration_seconds_bucket{job="backend"}[5m])) by (le)
) > 3
for: 10m
labels:
severity: critical
team: backend
annotations:
summary: "Critical HTTP p99 latency ({{ $value | humanizeDuration }})"
description: "The 99th percentile backend HTTP request latency has exceeded 3s for more than 10 minutes."
runbook_url: "https://docs.example.com/runbooks/http-latency"
- name: database
rules:
- alert: DatabaseConnectionFailures
expr: |
sum(rate(db_connection_errors_total{job="backend"}[5m])) > 0
for: 5m
labels:
severity: critical
team: backend
annotations:
summary: "Database connection failures detected"
description: "The backend is experiencing database connection errors at a rate of {{ $value | humanize }}/s over the last 5 minutes."
runbook_url: "https://docs.example.com/runbooks/database-connection"
- alert: DatabaseConnectionPoolExhausted
expr: |
(
db_connection_pool_in_use{job="backend"}
/
db_connection_pool_max{job="backend"}
) > 0.9
for: 5m
labels:
severity: warning
team: backend
annotations:
summary: "Database connection pool nearly exhausted ({{ $value | humanizePercentage }})"
description: "More than 90% of the backend database connection pool has been in use for over 5 minutes."
runbook_url: "https://docs.example.com/runbooks/database-connection"
- alert: DatabaseDown
expr: |
up{job="database"} == 0
for: 1m
labels:
severity: critical
team: backend
annotations:
summary: "Database instance {{ $labels.instance }} is down"
description: "Database target {{ $labels.instance }} has been unreachable for more than 1 minute."
runbook_url: "https://docs.example.com/runbooks/database-down"
- name: backups
rules:
- alert: BackupJobFailed
expr: |
soroban_backup_success == 0
for: 5m
labels:
severity: critical
team: backend
annotations:
summary: "Backup job failed for {{ $labels.instance }}"
description: "The most recent backup run for {{ $labels.instance }} did not succeed (soroban_backup_success == 0, written by scripts/backup.sh) for more than 5 minutes."
runbook_url: "https://docs.example.com/runbooks/backup-failed"
- alert: BackupStale
expr: |
(time() - soroban_backup_last_success_timestamp_seconds) > 26 * 3600
for: 15m
labels:
severity: warning
team: backend
annotations:
summary: "Backup is stale for {{ $labels.instance }}"
description: "The last successful backup for {{ $labels.instance }} was more than 26 hours ago, exceeding the expected backup interval."
runbook_url: "https://docs.example.com/runbooks/backup-stale"
- name: stellar-soroban-rpc
rules:
- alert: StellarRpcErrors
expr: |
sum(rate(stellar_rpc_errors_total{job="backend"}[5m])) > 0
for: 5m
labels:
severity: warning
team: backend
annotations:
summary: "Stellar RPC errors detected"
description: "The backend is experiencing Stellar RPC errors at a rate of {{ $value | humanize }}/s over the last 5 minutes."
runbook_url: "https://docs.example.com/runbooks/stellar-rpc"
- alert: StellarRpcHighErrorRate
expr: |
(
sum(rate(stellar_rpc_errors_total{job="backend"}[5m]))
/
sum(rate(stellar_rpc_requests_total{job="backend"}[5m]))
) > 0.05
for: 5m
labels:
severity: critical
team: backend
annotations:
summary: "High Stellar RPC error rate ({{ $value | humanizePercentage }})"
description: "More than 5% of Stellar RPC requests have failed over the last 5 minutes."
runbook_url: "https://docs.example.com/runbooks/stellar-rpc"
- alert: SorobanRpcErrors
expr: |
sum(rate(soroban_rpc_errors_total{job="backend"}[5m])) > 0
for: 5m
labels:
severity: warning
team: backend
annotations:
summary: "Soroban RPC errors detected"
description: "The backend is experiencing Soroban RPC errors at a rate of {{ $value | humanize }}/s over the last 5 minutes."
runbook_url: "https://docs.example.com/runbooks/soroban-rpc"
- alert: SorobanRpcHighErrorRate
expr: |
(
sum(rate(soroban_rpc_errors_total{job="backend"}[5m]))
/
sum(rate(soroban_rpc_requests_total{job="backend"}[5m]))
) > 0.05
for: 5m
labels:
severity: critical
team: backend
annotations:
summary: "High Soroban RPC error rate ({{ $value | humanizePercentage }})"
description: "More than 5% of Soroban RPC requests have failed over the last 5 minutes."
runbook_url: "https://docs.example.com/runbooks/soroban-rpc"
- alert: StellarRpcLatencyHigh
expr: |
histogram_quantile(
0.95,
sum(rate(stellar_rpc_request_duration_seconds_bucket{job="backend"}[5m])) by (le)
) > 2
for: 10m
labels:
severity: warning
team: backend
annotations:
summary: "High Stellar RPC latency ({{ $value | humanizeDuration }})"
description: "The 95th percentile Stellar RPC request latency has exceeded 2s for more than 10 minutes."
runbook_url: "https://docs.example.com/runbooks/stellar-rpc"
- alert: SorobanRpcLatencyHigh
expr: |
histogram_quantile(
0.95,
sum(rate(soroban_rpc_request_duration_seconds_bucket{job="backend"}[5m])) by (le)
) > 2
for: 10m
labels:
severity: warning
team: backend
annotations:
summary: "High Soroban RPC latency ({{ $value | humanizeDuration }})"
description: "The 95th percentile Soroban RPC request latency has exceeded 2s for more than 10 minutes."
runbook_url: "https://docs.example.com/runbooks/soroban-rpc"