@leverege/build-tools 2.66.0 → 2.66.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,318 @@
1
+ # https://samber.github.io/awesome-prometheus-alerts/rules#prometheus-self-monitoring
2
+ apiVersion: monitoring.coreos.com/v1
3
+ kind: PrometheusRule
4
+ metadata:
5
+ name: embedded-exporter
6
+ namespace: prometheus
7
+ spec:
8
+ groups:
9
+ - name: EmbeddedExporter-rules
10
+ rules:
11
+ - alert: PrometheusJobMissing
12
+ expr: absent(up{job="prometheus"})
13
+ for: 0m
14
+ labels:
15
+ severity: warning
16
+ annotations:
17
+ summary: Prometheus job missing (instance {{ $labels.instance }})
18
+ description: |-
19
+ A Prometheus job has disappeared
20
+ VALUE = {{ $value }}
21
+ LABELS = {{ $labels }}
22
+ - alert: PrometheusTargetMissing
23
+ expr: up == 0
24
+ for: 0m
25
+ labels:
26
+ severity: critical
27
+ annotations:
28
+ summary: Prometheus target missing (instance {{ $labels.instance }})
29
+ description: |-
30
+ A Prometheus target has disappeared. An exporter might be crashed.
31
+ VALUE = {{ $value }}
32
+ LABELS = {{ $labels }}
33
+ - alert: PrometheusAllTargetsMissing
34
+ expr: sum by (job) (up) == 0
35
+ for: 0m
36
+ labels:
37
+ severity: critical
38
+ annotations:
39
+ summary: Prometheus all targets missing (instance {{ $labels.instance }})
40
+ description: |-
41
+ A Prometheus job does not have living target anymore.
42
+ VALUE = {{ $value }}
43
+ LABELS = {{ $labels }}
44
+ - alert: PrometheusTargetMissingWithWarmupTime
45
+ expr: sum by (instance, job) ((up == 0) * on (instance) group_left(__name__) (node_time_seconds - node_boot_time_seconds > 600))
46
+ for: 0m
47
+ labels:
48
+ severity: critical
49
+ annotations:
50
+ summary: Prometheus target missing with warmup time (instance {{ $labels.instance }})
51
+ description: |-
52
+ Allow a job time to start up (10 minutes) before alerting that it's down.
53
+ VALUE = {{ $value }}
54
+ LABELS = {{ $labels }}
55
+ - alert: PrometheusConfigurationReloadFailure
56
+ expr: prometheus_config_last_reload_successful != 1
57
+ for: 0m
58
+ labels:
59
+ severity: warning
60
+ annotations:
61
+ summary: Prometheus configuration reload failure (instance {{ $labels.instance }})
62
+ description: |-
63
+ Prometheus configuration reload error
64
+ VALUE = {{ $value }}
65
+ LABELS = {{ $labels }}
66
+ - alert: PrometheusTooManyRestarts
67
+ expr: changes(process_start_time_seconds{job=~"prometheus|pushgateway|alertmanager"}[15m]) > 2
68
+ for: 0m
69
+ labels:
70
+ severity: warning
71
+ annotations:
72
+ summary: Prometheus too many restarts (instance {{ $labels.instance }})
73
+ description: |-
74
+ Prometheus has restarted more than twice in the last 15 minutes. It might be crashlooping.
75
+ VALUE = {{ $value }}
76
+ LABELS = {{ $labels }}
77
+ - alert: PrometheusAlertmanagerJobMissing
78
+ expr: absent(up{job="alertmanager"})
79
+ for: 0m
80
+ labels:
81
+ severity: warning
82
+ annotations:
83
+ summary: Prometheus AlertManager job missing (instance {{ $labels.instance }})
84
+ description: |-
85
+ A Prometheus AlertManager job has disappeared
86
+ VALUE = {{ $value }}
87
+ LABELS = {{ $labels }}
88
+ - alert: PrometheusAlertmanagerConfigurationReloadFailure
89
+ expr: alertmanager_config_last_reload_successful != 1
90
+ for: 0m
91
+ labels:
92
+ severity: warning
93
+ annotations:
94
+ summary: Prometheus AlertManager configuration reload failure (instance {{ $labels.instance }})
95
+ description: |-
96
+ AlertManager configuration reload error
97
+ VALUE = {{ $value }}
98
+ LABELS = {{ $labels }}
99
+ - alert: PrometheusAlertmanagerConfigNotSynced
100
+ expr: count(count_values("config_hash", alertmanager_config_hash)) > 1
101
+ for: 0m
102
+ labels:
103
+ severity: warning
104
+ annotations:
105
+ summary: Prometheus AlertManager config not synced (instance {{ $labels.instance }})
106
+ description: |-
107
+ Configurations of AlertManager cluster instances are out of sync
108
+ VALUE = {{ $value }}
109
+ LABELS = {{ $labels }}
110
+ - alert: PrometheusAlertmanagerE2eDeadManSwitch
111
+ expr: vector(1)
112
+ for: 0m
113
+ labels:
114
+ severity: critical
115
+ annotations:
116
+ summary: Prometheus AlertManager E2E dead man switch (instance {{ $labels.instance }})
117
+ description: |-
118
+ Prometheus DeadManSwitch is an always-firing alert. It's used as an end-to-end test of Prometheus through the Alertmanager.
119
+ VALUE = {{ $value }}
120
+ LABELS = {{ $labels }}
121
+ - alert: PrometheusNotConnectedToAlertmanager
122
+ expr: prometheus_notifications_alertmanagers_discovered < 1
123
+ for: 0m
124
+ labels:
125
+ severity: critical
126
+ annotations:
127
+ summary: Prometheus not connected to alertmanager (instance {{ $labels.instance }})
128
+ description: |-
129
+ Prometheus cannot connect the alertmanager
130
+ VALUE = {{ $value }}
131
+ LABELS = {{ $labels }}
132
+ - alert: PrometheusRuleEvaluationFailures
133
+ expr: increase(prometheus_rule_evaluation_failures_total[3m]) > 0
134
+ for: 0m
135
+ labels:
136
+ severity: critical
137
+ annotations:
138
+ summary: Prometheus rule evaluation failures (instance {{ $labels.instance }})
139
+ description: |-
140
+ Prometheus encountered {{ $value }} rule evaluation failures, leading to potentially ignored alerts.
141
+ VALUE = {{ $value }}
142
+ LABELS = {{ $labels }}
143
+ - alert: PrometheusTemplateTextExpansionFailures
144
+ expr: increase(prometheus_template_text_expansion_failures_total[3m]) > 0
145
+ for: 0m
146
+ labels:
147
+ severity: critical
148
+ annotations:
149
+ summary: Prometheus template text expansion failures (instance {{ $labels.instance }})
150
+ description: |-
151
+ Prometheus encountered {{ $value }} template text expansion failures
152
+ VALUE = {{ $value }}
153
+ LABELS = {{ $labels }}
154
+ - alert: PrometheusRuleEvaluationSlow
155
+ expr: prometheus_rule_group_last_duration_seconds > prometheus_rule_group_interval_seconds
156
+ for: 5m
157
+ labels:
158
+ severity: warning
159
+ annotations:
160
+ summary: Prometheus rule evaluation slow (instance {{ $labels.instance }})
161
+ description: |-
162
+ Prometheus rule evaluation took more time than the scheduled interval. It indicates a slower storage backend access or too complex query.
163
+ VALUE = {{ $value }}
164
+ LABELS = {{ $labels }}
165
+ - alert: PrometheusNotificationsBacklog
166
+ expr: min_over_time(prometheus_notifications_queue_length[10m]) > 0
167
+ for: 0m
168
+ labels:
169
+ severity: warning
170
+ annotations:
171
+ summary: Prometheus notifications backlog (instance {{ $labels.instance }})
172
+ description: |-
173
+ The Prometheus notification queue has not been empty for 10 minutes
174
+ VALUE = {{ $value }}
175
+ LABELS = {{ $labels }}
176
+ - alert: PrometheusAlertmanagerNotificationFailing
177
+ expr: rate(alertmanager_notifications_failed_total[1m]) > 0
178
+ for: 0m
179
+ labels:
180
+ severity: critical
181
+ annotations:
182
+ summary: Prometheus AlertManager notification failing (instance {{ $labels.instance }})
183
+ description: |-
184
+ Alertmanager is failing sending notifications
185
+ VALUE = {{ $value }}
186
+ LABELS = {{ $labels }}
187
+ - alert: PrometheusTargetEmpty
188
+ expr: prometheus_sd_discovered_targets == 0
189
+ for: 0m
190
+ labels:
191
+ severity: critical
192
+ annotations:
193
+ summary: Prometheus target empty (instance {{ $labels.instance }})
194
+ description: |-
195
+ Prometheus has no target in service discovery
196
+ VALUE = {{ $value }}
197
+ LABELS = {{ $labels }}
198
+ - alert: PrometheusTargetScrapingSlow
199
+ expr: prometheus_target_interval_length_seconds{quantile="0.9"} / on (interval, instance, job) prometheus_target_interval_length_seconds{quantile="0.5"} > 1.05
200
+ for: 5m
201
+ labels:
202
+ severity: warning
203
+ annotations:
204
+ summary: Prometheus target scraping slow (instance {{ $labels.instance }})
205
+ description: |-
206
+ Prometheus is scraping exporters slowly since it exceeded the requested interval time. Your Prometheus server is under-provisioned.
207
+ VALUE = {{ $value }}
208
+ LABELS = {{ $labels }}
209
+ - alert: PrometheusLargeScrape
210
+ expr: increase(prometheus_target_scrapes_exceeded_sample_limit_total[10m]) > 10
211
+ for: 5m
212
+ labels:
213
+ severity: warning
214
+ annotations:
215
+ summary: Prometheus large scrape (instance {{ $labels.instance }})
216
+ description: |-
217
+ Prometheus has many scrapes that exceed the sample limit
218
+ VALUE = {{ $value }}
219
+ LABELS = {{ $labels }}
220
+ - alert: PrometheusTargetScrapeDuplicate
221
+ expr: increase(prometheus_target_scrapes_sample_duplicate_timestamp_total[5m]) > 0
222
+ for: 0m
223
+ labels:
224
+ severity: warning
225
+ annotations:
226
+ summary: Prometheus target scrape duplicate (instance {{ $labels.instance }})
227
+ description: |-
228
+ Prometheus has many samples rejected due to duplicate timestamps but different values
229
+ VALUE = {{ $value }}
230
+ LABELS = {{ $labels }}
231
+ - alert: PrometheusTsdbCheckpointCreationFailures
232
+ expr: increase(prometheus_tsdb_checkpoint_creations_failed_total[1m]) > 0
233
+ for: 0m
234
+ labels:
235
+ severity: critical
236
+ annotations:
237
+ summary: Prometheus TSDB checkpoint creation failures (instance {{ $labels.instance }})
238
+ description: |-
239
+ Prometheus encountered {{ $value }} checkpoint creation failures
240
+ VALUE = {{ $value }}
241
+ LABELS = {{ $labels }}
242
+ - alert: PrometheusTsdbCheckpointDeletionFailures
243
+ expr: increase(prometheus_tsdb_checkpoint_deletions_failed_total[1m]) > 0
244
+ for: 0m
245
+ labels:
246
+ severity: critical
247
+ annotations:
248
+ summary: Prometheus TSDB checkpoint deletion failures (instance {{ $labels.instance }})
249
+ description: |-
250
+ Prometheus encountered {{ $value }} checkpoint deletion failures
251
+ VALUE = {{ $value }}
252
+ LABELS = {{ $labels }}
253
+ - alert: PrometheusTsdbCompactionsFailed
254
+ expr: increase(prometheus_tsdb_compactions_failed_total[1m]) > 0
255
+ for: 0m
256
+ labels:
257
+ severity: critical
258
+ annotations:
259
+ summary: Prometheus TSDB compactions failed (instance {{ $labels.instance }})
260
+ description: |-
261
+ Prometheus encountered {{ $value }} TSDB compactions failures
262
+ VALUE = {{ $value }}
263
+ LABELS = {{ $labels }}
264
+ - alert: PrometheusTsdbHeadTruncationsFailed
265
+ expr: increase(prometheus_tsdb_head_truncations_failed_total[1m]) > 0
266
+ for: 0m
267
+ labels:
268
+ severity: critical
269
+ annotations:
270
+ summary: Prometheus TSDB head truncations failed (instance {{ $labels.instance }})
271
+ description: |-
272
+ Prometheus encountered {{ $value }} TSDB head truncation failures
273
+ VALUE = {{ $value }}
274
+ LABELS = {{ $labels }}
275
+ - alert: PrometheusTsdbReloadFailures
276
+ expr: increase(prometheus_tsdb_reloads_failures_total[1m]) > 0
277
+ for: 0m
278
+ labels:
279
+ severity: critical
280
+ annotations:
281
+ summary: Prometheus TSDB reload failures (instance {{ $labels.instance }})
282
+ description: |-
283
+ Prometheus encountered {{ $value }} TSDB reload failures
284
+ VALUE = {{ $value }}
285
+ LABELS = {{ $labels }}
286
+ - alert: PrometheusTsdbWalCorruptions
287
+ expr: increase(prometheus_tsdb_wal_corruptions_total[1m]) > 0
288
+ for: 0m
289
+ labels:
290
+ severity: critical
291
+ annotations:
292
+ summary: Prometheus TSDB WAL corruptions (instance {{ $labels.instance }})
293
+ description: |-
294
+ Prometheus encountered {{ $value }} TSDB WAL corruptions
295
+ VALUE = {{ $value }}
296
+ LABELS = {{ $labels }}
297
+ - alert: PrometheusTsdbWalTruncationsFailed
298
+ expr: increase(prometheus_tsdb_wal_truncations_failed_total[1m]) > 0
299
+ for: 0m
300
+ labels:
301
+ severity: critical
302
+ annotations:
303
+ summary: Prometheus TSDB WAL truncations failed (instance {{ $labels.instance }})
304
+ description: |-
305
+ Prometheus encountered {{ $value }} TSDB WAL truncation failures
306
+ VALUE = {{ $value }}
307
+ LABELS = {{ $labels }}
308
+ - alert: PrometheusTimeseriesCardinality
309
+ expr: label_replace(count by(__name__) ({__name__=~".+"}), "name", "$1", "__name__", "(.+)") > 10000
310
+ for: 0m
311
+ labels:
312
+ severity: warning
313
+ annotations:
314
+ summary: Prometheus timeseries cardinality (instance {{ $labels.instance }})
315
+ description: |-
316
+ The "{{ $labels.name }}" timeseries cardinality is getting very high: {{ $value }}
317
+ VALUE = {{ $value }}
318
+ LABELS = {{ $labels }}
@@ -0,0 +1,142 @@
1
+ # https://samber.github.io/awesome-prometheus-alerts/rules#redis
2
+ apiVersion: monitoring.coreos.com/v1
3
+ kind: PrometheusRule
4
+ metadata:
5
+ name: oliver006-redis-exporter
6
+ namespace: prometheus
7
+ spec:
8
+ groups:
9
+ - name: Oliver006RedisExporter-rules
10
+ rules:
11
+ - alert: RedisDown
12
+ expr: redis_up == 0
13
+ for: 0m
14
+ labels:
15
+ severity: critical
16
+ annotations:
17
+ summary: Redis down (instance {{ $labels.instance }})
18
+ description: |-
19
+ Redis instance is down
20
+ VALUE = {{ $value }}
21
+ LABELS = {{ $labels }}
22
+ - alert: RedisMissingMaster
23
+ expr: (count(redis_instance_info{role="master"}) or vector(0)) < 1
24
+ for: 0m
25
+ labels:
26
+ severity: critical
27
+ annotations:
28
+ summary: Redis missing master (instance {{ $labels.instance }})
29
+ description: |-
30
+ Redis cluster has no node marked as master.
31
+ VALUE = {{ $value }}
32
+ LABELS = {{ $labels }}
33
+ - alert: RedisTooManyMasters
34
+ expr: count(redis_instance_info{role="master"}) > 1
35
+ for: 0m
36
+ labels:
37
+ severity: critical
38
+ annotations:
39
+ summary: Redis too many masters (instance {{ $labels.instance }})
40
+ description: |-
41
+ Redis cluster has too many nodes marked as master.
42
+ VALUE = {{ $value }}
43
+ LABELS = {{ $labels }}
44
+ - alert: RedisDisconnectedSlaves
45
+ expr: count without (instance, job) (redis_connected_slaves) - sum without (instance, job) (redis_connected_slaves) - 1 > 0
46
+ for: 0m
47
+ labels:
48
+ severity: critical
49
+ annotations:
50
+ summary: Redis disconnected slaves (instance {{ $labels.instance }})
51
+ description: |-
52
+ Redis not replicating for all slaves. Consider reviewing the redis replication status.
53
+ VALUE = {{ $value }}
54
+ LABELS = {{ $labels }}
55
+ - alert: RedisReplicationBroken
56
+ expr: delta(redis_connected_slaves[1m]) < 0
57
+ for: 0m
58
+ labels:
59
+ severity: critical
60
+ annotations:
61
+ summary: Redis replication broken (instance {{ $labels.instance }})
62
+ description: |-
63
+ Redis instance lost a slave
64
+ VALUE = {{ $value }}
65
+ LABELS = {{ $labels }}
66
+ - alert: RedisClusterFlapping
67
+ expr: changes(redis_connected_slaves[1m]) > 1
68
+ for: 2m
69
+ labels:
70
+ severity: critical
71
+ annotations:
72
+ summary: Redis cluster flapping (instance {{ $labels.instance }})
73
+ description: |-
74
+ Changes have been detected in Redis replica connection. This can occur when replica nodes lose connection to the master and reconnect (a.k.a flapping).
75
+ VALUE = {{ $value }}
76
+ LABELS = {{ $labels }}
77
+ - alert: RedisMissingBackup
78
+ expr: time() - redis_rdb_last_save_timestamp_seconds > 60 * 60 * 24
79
+ for: 0m
80
+ labels:
81
+ severity: critical
82
+ annotations:
83
+ summary: Redis missing backup (instance {{ $labels.instance }})
84
+ description: |-
85
+ Redis has not been backuped for 24 hours
86
+ VALUE = {{ $value }}
87
+ LABELS = {{ $labels }}
88
+ - alert: RedisOutOfSystemMemory
89
+ expr: redis_memory_used_bytes / redis_total_system_memory_bytes * 100 > 90
90
+ for: 2m
91
+ labels:
92
+ severity: warning
93
+ annotations:
94
+ summary: Redis out of system memory (instance {{ $labels.instance }})
95
+ description: |-
96
+ Redis is running out of system memory (> 90%)
97
+ VALUE = {{ $value }}
98
+ LABELS = {{ $labels }}
99
+ - alert: RedisOutOfConfiguredMaxmemory
100
+ expr: redis_memory_used_bytes / redis_memory_max_bytes * 100 > 90 and on(instance) redis_memory_max_bytes > 0
101
+ for: 2m
102
+ labels:
103
+ severity: warning
104
+ annotations:
105
+ summary: Redis out of configured maxmemory (instance {{ $labels.instance }})
106
+ description: |-
107
+ Redis is running out of configured maxmemory (> 90%)
108
+ VALUE = {{ $value }}
109
+ LABELS = {{ $labels }}
110
+ - alert: RedisTooManyConnections
111
+ expr: redis_connected_clients / redis_config_maxclients * 100 > 90
112
+ for: 2m
113
+ labels:
114
+ severity: warning
115
+ annotations:
116
+ summary: Redis too many connections (instance {{ $labels.instance }})
117
+ description: |-
118
+ Redis is running out of connections (> 90% used)
119
+ VALUE = {{ $value }}
120
+ LABELS = {{ $labels }}
121
+ - alert: RedisNotEnoughConnections
122
+ expr: redis_connected_clients < 5
123
+ for: 2m
124
+ labels:
125
+ severity: warning
126
+ annotations:
127
+ summary: Redis not enough connections (instance {{ $labels.instance }})
128
+ description: |-
129
+ Redis instance should have more connections (> 5)
130
+ VALUE = {{ $value }}
131
+ LABELS = {{ $labels }}
132
+ - alert: RedisRejectedConnections
133
+ expr: increase(redis_rejected_connections_total[1m]) > 0
134
+ for: 0m
135
+ labels:
136
+ severity: critical
137
+ annotations:
138
+ summary: Redis rejected connections (instance {{ $labels.instance }})
139
+ description: |-
140
+ Some connections to Redis has been rejected
141
+ VALUE = {{ $value }}
142
+ LABELS = {{ $labels }}
@@ -0,0 +1,43 @@
1
+ # https://samber.github.io/awesome-prometheus-alerts/rules#traefik
2
+ apiVersion: monitoring.coreos.com/v1
3
+ kind: PrometheusRule
4
+ metadata:
5
+ name: embedded-exporter-v2
6
+ namespace: prometheus
7
+ spec:
8
+ groups:
9
+ - name: EmbeddedExporterV2-rules
10
+ rules:
11
+ - alert: TraefikServiceDown
12
+ expr: count(traefik_service_server_up) by (service) == 0
13
+ for: 0m
14
+ labels:
15
+ severity: critical
16
+ annotations:
17
+ summary: Traefik service down (instance {{ $labels.instance }})
18
+ description: |-
19
+ All Traefik services are down
20
+ VALUE = {{ $value }}
21
+ LABELS = {{ $labels }}
22
+ - alert: TraefikHighHttp4xxErrorRateService
23
+ expr: sum(rate(traefik_service_requests_total{code=~"4.*"}[3m])) by (service) / sum(rate(traefik_service_requests_total[3m])) by (service) * 100 > 5
24
+ for: 1m
25
+ labels:
26
+ severity: critical
27
+ annotations:
28
+ summary: Traefik high HTTP 4xx error rate service (instance {{ $labels.instance }})
29
+ description: |-
30
+ Traefik service 4xx error rate is above 5%
31
+ VALUE = {{ $value }}
32
+ LABELS = {{ $labels }}
33
+ - alert: TraefikHighHttp5xxErrorRateService
34
+ expr: sum(rate(traefik_service_requests_total{code=~"5.*"}[3m])) by (service) / sum(rate(traefik_service_requests_total[3m])) by (service) * 100 > 5
35
+ for: 1m
36
+ labels:
37
+ severity: critical
38
+ annotations:
39
+ summary: Traefik high HTTP 5xx error rate service (instance {{ $labels.instance }})
40
+ description: |-
41
+ Traefik service 5xx error rate is above 5%
42
+ VALUE = {{ $value }}
43
+ LABELS = {{ $labels }}
@@ -0,0 +1,109 @@
1
+ # https://samber.github.io/awesome-prometheus-alerts/rules#docker-containers
2
+ apiVersion: monitoring.coreos.com/v1
3
+ kind: PrometheusRule
4
+ metadata:
5
+ name: google-cadvisor
6
+ namespace: prometheus
7
+ spec:
8
+ groups:
9
+ - name: Cadvisor (awesome) # GoogleCadvisor-rules
10
+ rules:
11
+ - alert: ContainerKilled
12
+ expr: time() - container_last_seen > 60
13
+ for: 0m
14
+ labels:
15
+ severity: warning
16
+ annotations:
17
+ summary: Container killed (instance {{ $labels.instance }})
18
+ description: |-
19
+ A container has disappeared
20
+ VALUE = {{ $value }}
21
+ LABELS = {{ $labels }}
22
+ - alert: ContainerAbsent
23
+ expr: absent(container_last_seen)
24
+ for: 5m
25
+ labels:
26
+ severity: warning
27
+ annotations:
28
+ summary: Container absent (instance {{ $labels.instance }})
29
+ description: |-
30
+ A container is absent for 5 min
31
+ VALUE = {{ $value }}
32
+ LABELS = {{ $labels }}
33
+ - alert: ContainerHighCpuUtilization
34
+ expr: (sum(rate(container_cpu_usage_seconds_total{container!=""}[5m])) by (pod, container) / sum(container_spec_cpu_quota{container!=""}/container_spec_cpu_period{container!=""}) by (pod, container) * 100) > 80
35
+ for: 2m
36
+ labels:
37
+ severity: warning
38
+ annotations:
39
+ summary: Container High CPU utilization (instance {{ $labels.instance }})
40
+ description: |-
41
+ Container CPU utilization is above 80%
42
+ VALUE = {{ $value }}
43
+ LABELS = {{ $labels }}
44
+ - alert: ContainerHighMemoryUsage
45
+ expr: (sum(container_memory_working_set_bytes{name!=""}) BY (instance, name) / sum(container_spec_memory_limit_bytes > 0) BY (instance, name) * 100) > 80
46
+ for: 2m
47
+ labels:
48
+ severity: warning
49
+ annotations:
50
+ summary: Container High Memory usage (instance {{ $labels.instance }})
51
+ description: |-
52
+ Container Memory usage is above 80%
53
+ VALUE = {{ $value }}
54
+ LABELS = {{ $labels }}
55
+ - alert: ContainerVolumeUsage
56
+ expr: (1 - (sum(container_fs_inodes_free{name!=""}) BY (instance) / sum(container_fs_inodes_total) BY (instance))) * 100 > 80
57
+ for: 2m
58
+ labels:
59
+ severity: warning
60
+ annotations:
61
+ summary: Container Volume usage (instance {{ $labels.instance }})
62
+ description: |-
63
+ Container Volume usage is above 80%
64
+ VALUE = {{ $value }}
65
+ LABELS = {{ $labels }}
66
+ - alert: ContainerHighThrottleRate
67
+ expr: sum(increase(container_cpu_cfs_throttled_periods_total{container!=""}[5m])) by (container, pod, namespace) / sum(increase(container_cpu_cfs_periods_total[5m])) by (container, pod, namespace) > ( 25 / 100 )
68
+ for: 5m
69
+ labels:
70
+ severity: warning
71
+ annotations:
72
+ summary: Container high throttle rate (instance {{ $labels.instance }})
73
+ description: |-
74
+ Container is being throttled
75
+ VALUE = {{ $value }}
76
+ LABELS = {{ $labels }}
77
+ # - alert: ContainerHighLowChangeCpuUsage
78
+ # expr: (abs((sum by (instance, name) (rate(container_cpu_usage_seconds_total{name!=""}[1m])) * 100) - (sum by (instance, name) (rate(container_cpu_usage_seconds_total{name!=""}[1m] offset 1m)) * 100)) or abs((sum by (instance, name) (rate(container_cpu_usage_seconds_total{name!=""}[1m])) * 100) - (sum by (instance, name) (rate(container_cpu_usage_seconds_total{name!=""}[5m] offset 1m)) * 100))) > 25
79
+ # for: 0m
80
+ # labels:
81
+ # severity: info
82
+ # annotations:
83
+ # summary: Container high low change CPU usage (instance {{ $labels.instance }})
84
+ # description: |-
85
+ # This alert rule monitors the absolute change in CPU usage within a time window and triggers an alert when the change exceeds 25%.
86
+ # VALUE = {{ $value }}
87
+ # LABELS = {{ $labels }}
88
+ - alert: ContainerLowCpuUtilization
89
+ expr: (sum(rate(container_cpu_usage_seconds_total{container!=""}[5m])) by (pod, container) / sum(container_spec_cpu_quota{container!=""}/container_spec_cpu_period{container!=""}) by (pod, container) * 100) < 20
90
+ for: 7d
91
+ labels:
92
+ severity: info
93
+ annotations:
94
+ summary: Container Low CPU utilization (instance {{ $labels.instance }})
95
+ description: |-
96
+ Container CPU utilization is under 20% for 1 week. Consider reducing the allocated CPU.
97
+ VALUE = {{ $value }}
98
+ LABELS = {{ $labels }}
99
+ - alert: ContainerLowMemoryUsage
100
+ expr: (sum(container_memory_working_set_bytes{name!=""}) BY (instance, name) / sum(container_spec_memory_limit_bytes > 0) BY (instance, name) * 100) < 20
101
+ for: 7d
102
+ labels:
103
+ severity: info
104
+ annotations:
105
+ summary: Container Low Memory usage (instance {{ $labels.instance }})
106
+ description: |-
107
+ Container Memory usage is under 20% for 1 week. Consider reducing the allocated memory.
108
+ VALUE = {{ $value }}
109
+ LABELS = {{ $labels }}