@leverege/build-tools 2.21.13 → 2.22.0

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,786 @@
1
+ alertmanager:
2
+ affinity:
3
+ nodeAffinity:
4
+ preferredDuringSchedulingIgnoredDuringExecution:
5
+ - preference:
6
+ matchExpressions:
7
+ - key: cloud.google.com/gke-nodepool
8
+ operator: In
9
+ values:
10
+ - database
11
+ weight: 100
12
+ tolerations:
13
+ - key: "database"
14
+ operator: "Equal"
15
+ value: "true"
16
+ effect: "NoSchedule"
17
+
18
+ strategy:
19
+ type: Recreate
20
+
21
+ alertmanagerFiles:
22
+ alertmanager.yml:
23
+ receivers:
24
+ - name: slack
25
+ slack_configs:
26
+ - channel: "OVH:<SLACK_CHANNEL>"
27
+ api_url: "OVH:<SLACK_HOOK_URL>"
28
+ username: "OVH:<PROJECT_NAME>"
29
+ fallback: "OVH:<PROJECT_NAME> - {{ .CommonAnnotations.summary }}"
30
+ title: "{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}"
31
+ title_link: "https://bitbucket.org/leverege/sre-playbook/src/master/"
32
+ send_resolved: true
33
+ text: |-
34
+ {{ range .Alerts }}
35
+ *Alert:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`
36
+ *Description:* {{ .Annotations.description }}
37
+ *Dashboard:* {{ .Annotations.dashboard }}
38
+ {{ end }}
39
+ - name: opsgenie
40
+ opsgenie_configs:
41
+ - api_key: "OVH:<OPSGENIE_APIKEY>"
42
+ priority: "{{ .CommonLabels.priority }}"
43
+ tags: "{{ range .Alerts }}{{ .Labels.severity }},{{ end }}"
44
+ description: |-
45
+ {{ range .Alerts }}
46
+ *Alert:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`
47
+ *Description:* {{ .Annotations.description }}
48
+ *Dashboard:* {{ .Annotations.dashboard }}
49
+ {{ end }}
50
+
51
+ route:
52
+ group_wait: 10s
53
+ group_interval: 5m
54
+ receiver: slack
55
+ routes:
56
+ - match:
57
+ severity: page
58
+ receiver: opsgenie
59
+ repeat_interval: 6h
60
+
61
+ serverFiles:
62
+ alerting_rules.yml:
63
+ groups:
64
+ # UNCOMMENT IF YOU NEED ANOMALY DETECTION
65
+ # - name: PubSubRules
66
+ # rules:
67
+ # - record: job:pubsub_message_size:rate5m
68
+ # expr: sum by (topic_id) (rate(stackdriver_pubsub_topic_pubsub_googleapis_com_topic_message_sizes_count[5m]) )
69
+ # - record: job:pubsub_message_size:rate5m:avg_over_time_1w
70
+ # expr: avg_over_time(job:pubsub_message_size:rate5m[1w])
71
+ # - record: job:pubsub_message_size:rate5m:stddev_over_time_1w
72
+ # expr: stddev_over_time(job:pubsub_message_size:rate5m[1w])
73
+
74
+ - name: Kubernetes
75
+ rules:
76
+ - alert: KubernetesNodeNotReady
77
+ expr: kube_node_status_condition{condition="Ready",status="true"} == 0
78
+ for: 5m
79
+ labels:
80
+ severity: page
81
+ priority: P3
82
+ annotations:
83
+ summary: "Kubernetes Node is not ready"
84
+ description: "Node {{ $labels.node }} is stuck in unready state for more than 5m"
85
+ dashboard: "Check GKE or EKS node status"
86
+
87
+ - alert: KubernetesMemoryPressure
88
+ expr: kube_node_status_condition{condition="MemoryPressure",status="true"} == 1
89
+ for: 5m
90
+ labels:
91
+ severity: error
92
+ annotations:
93
+ summary: "Kubernetes memory pressure"
94
+ description: "{{ $labels.node }} has a MemoryPressure condition"
95
+ dashboard: "Check GKE or EKS node status"
96
+
97
+ - alert: KubernetesDiskPressure
98
+ expr: kube_node_status_condition{condition="DiskPressure",status="true"} == 1
99
+ for: 5m
100
+ labels:
101
+ severity: error
102
+ annotations:
103
+ summary: "Kubernetes disk pressure"
104
+ description: "{{ $labels.node }} has DiskPressure condition"
105
+ dashboard: "Check GKE or EKS node status"
106
+
107
+ - alert: KubernetesOutOfDisk
108
+ expr: kube_node_status_condition{condition="OutOfDisk",status="true"} == 1
109
+ for: 5m
110
+ labels:
111
+ severity: error
112
+ annotations:
113
+ summary: "Kubernetes out of disk"
114
+ description: "{{ $labels.node }} has is out of disk space"
115
+ dashboard: "Check GKE or EKS node status"
116
+
117
+ - alert: KubernetesVolumeOutOfDiskSpace
118
+ expr: kubelet_volume_stats_available_bytes / kubelet_volume_stats_capacity_bytes * 100 < 20
119
+ for: 5m
120
+ labels:
121
+ severity: page
122
+ priority: P2
123
+ annotations:
124
+ summary: "Kubernetes Volume out of disk space"
125
+ description: "Volume is almost full (< 10% left)"
126
+ dashboard: "OVH:<MONITORING>/pvc"
127
+
128
+ # - alert: KubernetesVolumeFullInFourDays
129
+ # expr: predict_linear(kubelet_volume_stats_available_bytes[6h], 4 * 24 * 3600) < 0
130
+ # for: 5m
131
+ # labels:
132
+ # severity: error
133
+ # annotations:
134
+ # summary: "Kubernetes Volume full in four days "
135
+ # description: "{{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is expected to fill up within four days. Currently {{ $value | humanize }}% is available."
136
+ # dashboard: "OVH:<MONITORING>/pvc"
137
+
138
+ - alert: KubernetesPersistentvolumeError
139
+ expr: kube_persistentvolume_status_phase{phase=~"Failed|Pending",job="kube-state-metrics"} > 0
140
+ for: 5m
141
+ labels:
142
+ severity: error
143
+ annotations:
144
+ summary: "Kubernetes PersistentVolume error "
145
+ description: "PersistentVolumeClaim {{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is stuck pending"
146
+ dashboard: "Check GKE or EKS PVC/storage status"
147
+
148
+ - alert: KubernetesHpaScaleCapability
149
+ expr: kube_hpa_status_desired_replicas >= kube_hpa_spec_max_replicas
150
+ for: 15m
151
+ labels:
152
+ severity: warning
153
+ annotations:
154
+ summary: "Kubernetes HPA scale capability"
155
+ description: "Kubernetes has scaled {{ $labels.hpa }} to max number of scaled pods."
156
+ dashboard: "OVH:<MONITORING>/k8-deployment"
157
+
158
+ - alert: KubernetesPodNotHealthy
159
+ expr: kube_pod_status_phase{phase=~"Pending|Unknown|Failed"} == 1
160
+ for: 10m
161
+ labels:
162
+ severity: error
163
+ annotations:
164
+ summary: "Kubernetes Pod not healthy"
165
+ description: "Pod {{ $labels.pod }} has been in a non-ready state for longer than a 10m."
166
+ dashboard: "Check the pod status using the Kubernetes UI"
167
+
168
+ - alert: KubernetesPodCrashLooping
169
+ expr: rate(kube_pod_container_status_restarts_total[15m]) * 60 * 5 > 5
170
+ for: 5m
171
+ labels:
172
+ severity: page
173
+ priority: P2
174
+ annotations:
175
+ summary: "Kubernetes pod crash looping"
176
+ description: "{{ $labels.pod }} is in a crash loop"
177
+ dashboard: "Check the pod status using the Kubernetes UI"
178
+
179
+ - name: Prometheus
180
+ rules:
181
+ - alert: targets_down
182
+ expr: up{target_env!="preemptibles"} == 0
183
+ for: 10m
184
+ labels:
185
+ severity: warning
186
+ annotations:
187
+ summary: Prometheus target missing
188
+ description: "Prometheus failed to scrape {{ $labels.app }}"
189
+ dashboard: "See prometheus.md in SRE Playbook"
190
+
191
+ - alert: PrometheusConfigurationReloadFailure
192
+ expr: prometheus_config_last_reload_successful != 1
193
+ for: 5m
194
+ labels:
195
+ severity: warning
196
+ annotations:
197
+ summary: "Prometheus server configuration reload failure"
198
+ description: "Prometheus server failed to reload server configs (e.g. alerts, rules)"
199
+ dashboard: "See prometheus.md in SRE Playbook"
200
+
201
+ - alert: PrometheusAlertmanagerConfigurationReloadFailure
202
+ expr: alertmanager_config_last_reload_successful != 1
203
+ for: 5m
204
+ labels:
205
+ severity: warning
206
+ annotations:
207
+ summary: "Prometheus AlertManager configuration reload failure"
208
+ description: "AlertManager failed to reload alert configs (e.g. slack, opsgenie)"
209
+ dashboard: "See prometheus.md in SRE Playbook"
210
+
211
+ - alert: PrometheusTooManyRestarts
212
+ expr: changes(process_start_time_seconds{job=~"prometheus|alertmanager"}[15m]) > 2
213
+ for: 5m
214
+ labels:
215
+ severity: warning
216
+ annotations:
217
+ summary: "Prometheus is in a crash loop"
218
+ description: "Prometheus {{ $labels.component }} has restarted more than twice in the last 15 minutes. It might be crashlooping."
219
+ dashboard: "See prometheus.md in SRE Playbook"
220
+
221
+ - alert: PrometheusNotConnectedToAlertmanager
222
+ expr: prometheus_notifications_alertmanagers_discovered < 1
223
+ for: 5m
224
+ labels:
225
+ severity: error
226
+ annotations:
227
+ summary: "Prometheus not connected to alertmanager"
228
+ description: "Prometheus cannot connect the alertmanager - new alerts may not be detected"
229
+ dashboard: "See prometheus.md in SRE Playbook"
230
+
231
+ - alert: PrometheusNotificationsBacklog
232
+ expr: min_over_time(prometheus_notifications_queue_length[10m]) > 0
233
+ for: 5m
234
+ labels:
235
+ severity: warning
236
+ annotations:
237
+ summary: "Prometheus notifications backlog"
238
+ description: "The Prometheus notification queue has not been empty for 10 minutes"
239
+ dashboard: "See prometheus.md in SRE Playbook"
240
+
241
+ - alert: PrometheusAlertmanagerNotificationFailing
242
+ expr: rate(alertmanager_notifications_failed_total[1m]) > 0
243
+ for: 5m
244
+ labels:
245
+ severity: error
246
+ annotations:
247
+ summary: "Prometheus AlertManager notification failing"
248
+ description: "Alertmanager is failing to send notifications"
249
+ dashboard: "See prometheus.md in SRE Playbook"
250
+
251
+ - name: GCP
252
+ rules:
253
+ - alert: StackdriverFailedScrape
254
+ expr: absent(stackdriver_pubsub_topic_pubsub_googleapis_com_topic_message_sizes_count) == 1
255
+ for: 10m
256
+ labels:
257
+ severity: warning
258
+ annotations:
259
+ summary: "Stackdriver metrics unavailable"
260
+ description: "Prometheus failed to scrape Stackdriver metrics"
261
+ dashboard: "Use Stackdriver Monitoring on GCP UI"
262
+ - alert: HighFirebaseLoad
263
+ expr: stackdriver_firebase_namespace_firebasedatabase_googleapis_com_io_database_load > 0.9
264
+ for: 5m
265
+ labels:
266
+ severity: warning
267
+ annotations:
268
+ summary: "High Firebase load detected"
269
+ description: "Firebase load is above 90% (current value is: {{ $value | humanize }}%)"
270
+ dashboard: "OVH:<MONITORING>/firebase"
271
+ - alert: PubSubUndeliveredMessages
272
+ expr: sum(stackdriver_pubsub_subscription_pubsub_googleapis_com_subscription_num_undelivered_messages) by (subscription_id) > 1000
273
+ for: 5m
274
+ labels:
275
+ severity: page
276
+ priority: P3
277
+ annotations:
278
+ summary: "High Number of Undelivered Messages on PubSub"
279
+ description: "Undelivered message count on topic {{$labels.subscription_id}} is greater than 1000"
280
+ dashboard: "OVH:<MONITORING>/stackdriver"
281
+ - alert: PubSubOldUnackedMessages
282
+ expr: stackdriver_pubsub_subscription_pubsub_googleapis_com_subscription_oldest_unacked_message_age > 900
283
+ for: 5m
284
+ labels:
285
+ severity: warning
286
+ annotations:
287
+ summary: "Old messages left unacked on PubSub"
288
+ description: "Messages on {{$labels.subscription_id}} has been unacked for more than 15m"
289
+ dashboard: "OVH:<MONITORING>/stackdriver"
290
+
291
+ - name: Apps
292
+ rules:
293
+ - alert: frequent_app_restarts
294
+ expr: rate(nodejs_app_exit_count[15m]) * 60 * 5 > 5
295
+ for: 1m
296
+ labels:
297
+ severity: page
298
+ priority: P2
299
+ annotations:
300
+ summary: Apps are restarting frequently
301
+ description: "{{ $labels.app }} is in a crash loop"
302
+ dashboard: "OVH:<MONITORING>/stackdriver"
303
+
304
+ - name: MySQL
305
+ rules:
306
+ - alert: MysqlDown
307
+ expr: mysql_up == 0
308
+ for: 5m
309
+ labels:
310
+ severity: page
311
+ priority: P3
312
+ annotations:
313
+ summary: "MySQL down (instance {{ $labels.instance }})"
314
+ description: "MySQL pod is down. Look into manually restarting."
315
+ dashboard: "OVH:<MONITORING>/mysql"
316
+
317
+ - alert: MysqlSlowQueries
318
+ expr: mysql_global_status_slow_queries > 0
319
+ for: 5m
320
+ labels:
321
+ severity: warning
322
+ annotations:
323
+ summary: "MySQL slow queries detected"
324
+ description: "MySQL server is detected {{ $value }} slow queries."
325
+ dashboard: "OVH:<MONITORING>/mysql"
326
+
327
+ - alert: MysqlRestarted
328
+ expr: mysql_global_status_uptime < 60
329
+ for: 5m
330
+ labels:
331
+ severity: warning
332
+ annotations:
333
+ summary: "MySQL restarted"
334
+ description: "MySQL has just been restarted, less than one minute ago."
335
+ dashboard: "OVH:<MONITORING>/mysql"
336
+
337
+ - name: Postgres
338
+ rules:
339
+ - alert: PostgresqlDown
340
+ expr: pg_up == 0
341
+ for: 5m
342
+ labels:
343
+ severity: page
344
+ priority: P3
345
+ annotations:
346
+ summary: "Postgresql down"
347
+ description: "Postgresql instance is down: check {{ $labels.release }}"
348
+ dashboard: "OVH:<MONITORING>/postgres"
349
+
350
+ - alert: PostgresqlRestarted
351
+ expr: time() - pg_postmaster_start_time_seconds < 60
352
+ for: 5m
353
+ labels:
354
+ severity: error
355
+ annotations:
356
+ summary: "Postgresql restarted"
357
+ description: "Postgresql restarted: check {{ $labels.release }}"
358
+ dashboard: "OVH:<MONITORING>/postgres"
359
+
360
+ - alert: PostgresqlExporterError
361
+ expr: pg_exporter_last_scrape_error > 0
362
+ for: 5m
363
+ labels:
364
+ severity: warning
365
+ annotations:
366
+ summary: "Postgresql exporter error for {{ $labels.release }}"
367
+ description: "Postgresql exporter is showing errors. Metrics may be outdated"
368
+ dashboard: "OVH:<MONITORING>/postgres"
369
+
370
+ - alert: PostgresqlReplicationLag
371
+ expr: (pg_replication_lag > 10) and ON(instance) (pg_replication_is_replica == 1)
372
+ for: 5m
373
+ labels:
374
+ severity: warning
375
+ annotations:
376
+ summary: "Postgresql replication lag"
377
+ description: "PostgreSQL replication lag is going up (> 10s): check {{ $labels.release }}"
378
+ dashboard: "OVH:<MONITORING>/postgres"
379
+
380
+ - alert: PostgresqlTableNotVaccumed
381
+ expr: time() - pg_stat_user_tables_last_autovacuum > 60 * 60 * 24
382
+ for: 5m
383
+ labels:
384
+ severity: warning
385
+ annotations:
386
+ summary: "Postgresql table not vaccumed"
387
+ description: "Table has not been vaccum for 24 hours: check {{ $labels.release }}"
388
+ dashboard: "OVH:<MONITORING>/postgres"
389
+
390
+ - alert: PostgresqlTableNotAnalyzed
391
+ expr: time() - pg_stat_user_tables_last_autoanalyze > 60 * 60 * 24
392
+ for: 5m
393
+ labels:
394
+ severity: warning
395
+ annotations:
396
+ summary: "Postgresql table not analyzed (instance {{ $labels.instance }})"
397
+ description: "Table has not been analyzed for 24 hours: check {{ $labels.release }} - {{ $labels.datname }}"
398
+ dashboard: "OVH:<MONITORING>/postgres"
399
+
400
+ - alert: PostgresqlDeadLocks
401
+ expr: rate(pg_stat_database_deadlocks{datname!~"template.*|postgres"}[1m]) > 0
402
+ for: 5m
403
+ labels:
404
+ severity: warning
405
+ annotations:
406
+ summary: "Postgresql dead locks"
407
+ description: "PostgreSQL has dead-locks: check {{ $labels.release }} - {{ $labels.datname }}"
408
+ dashboard: "OVH:<MONITORING>/postgres"
409
+
410
+ - alert: PostgresqlSlowQueries
411
+ expr: pg_slow_queries > 0
412
+ for: 5m
413
+ labels:
414
+ severity: warning
415
+ annotations:
416
+ summary: "Postgresql slow queries"
417
+ description: "PostgreSQL executing slow queries"
418
+ dashboard: "OVH:<MONITORING>/postgres"
419
+
420
+ - alert: PostgresqlHighRollbackRate
421
+ expr: rate(pg_stat_database_xact_rollback{datname!~"template.*"}[3m]) / rate(pg_stat_database_xact_commit{datname!~"template.*"}[3m]) > 0.02
422
+ for: 5m
423
+ labels:
424
+ severity: warning
425
+ annotations:
426
+ summary: "Postgresql high rollback rate on {{ $labels.release }} - {{ $labels.datname }}"
427
+ description: "Ratio of transactions being aborted compared to committed is > 2 %"
428
+ dashboard: "OVH:<MONITORING>/postgres"
429
+
430
+ - alert: PostgresqlCommitRateLow
431
+ expr: rate(pg_stat_database_xact_commit[1m]) < 10
432
+ for: 5m
433
+ labels:
434
+ severity: error
435
+ annotations:
436
+ summary: "Postgresql commit rate low on {{ $labels.release }} - {{ $labels.datname }}"
437
+ description: "Postgres seems to be processing very few transactions"
438
+ dashboard: "OVH:<MONITORING>/postgres"
439
+
440
+ - alert: PostgresqlLowXidConsumption
441
+ expr: rate(pg_txid_current[1m]) < 5
442
+ for: 5m
443
+ labels:
444
+ severity: warning
445
+ annotations:
446
+ summary: "Postgresql low XID consumption on {{ $labels.release }} - {{ $labels.datname }}"
447
+ description: "Postgresql seems to be consuming transaction IDs very slowly"
448
+ dashboard: "OVH:<MONITORING>/postgres"
449
+
450
+ - alert: PostgresqllowXlogConsumption
451
+ expr: rate(pg_xlog_position_bytes[1m]) < 100
452
+ for: 5m
453
+ labels:
454
+ severity: warning
455
+ annotations:
456
+ summary: "Postgresqllow XLOG consumption on {{ $labels.release }} - {{ $labels.datname }}"
457
+ description: "Postgres seems to be consuming XLOG very slowly"
458
+ dashboard: "OVH:<MONITORING>/postgres"
459
+
460
+ - alert: PostgresqlWaleReplicationStopped
461
+ expr: rate(pg_xlog_position_bytes[1m]) == 0
462
+ for: 5m
463
+ labels:
464
+ severity: error
465
+ annotations:
466
+ summary: "Postgresql WAL-E replication stopped on {{ $labels.release }} - {{ $labels.datname }}"
467
+ description: "WAL-E replication seems to be stopped"
468
+ dashboard: "OVH:<MONITORING>/postgres"
469
+
470
+ - alert: PostgresqlHighRateStatementTimeout
471
+ expr: rate(postgresql_errors_total{type="statement_timeout"}[5m]) > 3
472
+ for: 5m
473
+ labels:
474
+ severity: error
475
+ annotations:
476
+ summary: "Postgresql high rate statement timeout"
477
+ description: "Postgres transactions showing high rate of statement timeouts on {{ $labels.release }} - {{ $labels.datname }}"
478
+ dashboard: "OVH:<MONITORING>/postgres"
479
+
480
+ - alert: PostgresqlHighRateDeadlock
481
+ expr: rate(postgresql_errors_total{type="deadlock_detected"}[1m]) * 60 > 1
482
+ for: 5m
483
+ labels:
484
+ severity: error
485
+ annotations:
486
+ summary: "Postgresql high rate deadlock"
487
+ description: "Postgres detected deadlocks on {{ $labels.release }} - {{ $labels.datname }}"
488
+ dashboard: "OVH:<MONITORING>/postgres"
489
+
490
+ - alert: PostgresqlReplicationLabBytes
491
+ expr: (pg_xlog_position_bytes and pg_replication_is_replica == 0) - on (environment) group_right(instance) (pg_xlog_position_bytes and pg_replication_is_replica == 1) > 1e+09
492
+ for: 5m
493
+ labels:
494
+ severity: error
495
+ annotations:
496
+ summary: "Postgresql replication lab bytes"
497
+ description: "Postgres Replication lag (in bytes) is high on {{ $labels.release }} - {{ $labels.datname }}"
498
+ dashboard: "OVH:<MONITORING>/postgres"
499
+
500
+ - alert: PostgresqlTooManyDeadTuples
501
+ expr: ((pg_stat_user_tables_n_dead_tup > 10000) / (pg_stat_user_tables_n_live_tup + pg_stat_user_tables_n_dead_tup)) >= 0.1 unless ON(instance) (pg_replication_is_replica == 1)
502
+ for: 5m
503
+ labels:
504
+ severity: warning
505
+ annotations:
506
+ summary: "Postgresql too many dead tuples"
507
+ description: "PostgreSQL dead tuples is too large ( {{ $value }} dead tuples) on {{ $labels.release }} - {{ $labels.datname }}"
508
+ dashboard: "OVH:<MONITORING>/postgres"
509
+
510
+ - alert: PostgresqlTooManyLocksAcquired
511
+ expr: ((sum (pg_locks_count)) / (pg_settings_max_locks_per_transaction * pg_settings_max_connections)) > 0.20
512
+ for: 5m
513
+ labels:
514
+ severity: error
515
+ annotations:
516
+ summary: "Postgresql too many locks acquired on {{ $labels.statefulset.kubernetes.io_pod_name }}"
517
+ description: "Too many locks acquired on the database. If this alert happens frequently, we may need to increase the postgres setting max_locks_per_transaction."
518
+ dashboard: "OVH:<MONITORING>/postgres"
519
+
520
+ - name: Redis
521
+ rules:
522
+ - alert: RedisDown
523
+ expr: redis_up == 0
524
+ for: 5m
525
+ labels:
526
+ severity: error
527
+ annotations:
528
+ summary: "Redis down (instance {{ $labels.instance }})"
529
+ description: "Redis instance is down"
530
+ dashboard: "OVH:<MONITORING>/redis"
531
+
532
+ - alert: RedisMissingMaster
533
+ expr: count(redis_instance_info{role="master"}) == 0
534
+ for: 5m
535
+ labels:
536
+ severity: error
537
+ annotations:
538
+ summary: "Redis missing master (instance {{ $labels.instance }})"
539
+ description: "Redis cluster has no node marked as master."
540
+ dashboard: "OVH:<MONITORING>/redis"
541
+
542
+ - alert: RedisTooManyMasters
543
+ expr: count(redis_instance_info{role="master"}) > 1
544
+ for: 5m
545
+ labels:
546
+ severity: error
547
+ annotations:
548
+ summary: "Redis too many masters (instance {{ $labels.instance }})"
549
+ description: "Redis cluster has too many nodes marked as master."
550
+ dashboard: "OVH:<MONITORING>/redis"
551
+
552
+ - alert: RedisDisconnectedSlaves
553
+ expr: count without (instance, job) (redis_connected_slaves) - sum without (instance, job) (redis_connected_slaves) - 1 > 1
554
+ for: 5m
555
+ labels:
556
+ severity: warning
557
+ annotations:
558
+ summary: "Redis disconnected slaves (instance {{ $labels.instance }})"
559
+ description: "Redis not replicating for all slaves. Consider reviewing the redis replication status."
560
+ dashboard: "OVH:<MONITORING>/redis"
561
+
562
+ - alert: RedisReplicationBroken
563
+ expr: delta(redis_connected_slaves[1m]) < 0
564
+ for: 5m
565
+ labels:
566
+ severity: warning
567
+ annotations:
568
+ summary: "Redis replication broken (instance {{ $labels.instance }})"
569
+ description: "Redis instance lost a slave"
570
+ dashboard: "OVH:<MONITORING>/redis"
571
+
572
+ - alert: RedisClusterFlapping
573
+ expr: changes(redis_connected_slaves[5m]) > 2
574
+ for: 5m
575
+ labels:
576
+ severity: error
577
+ annotations:
578
+ summary: "Redis cluster flapping (instance {{ $labels.instance }})"
579
+ description: "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)."
580
+ dashboard: "OVH:<MONITORING>/redis"
581
+
582
+ - alert: RedisOutOfMemory
583
+ expr: redis_memory_used_bytes / redis_total_system_memory_bytes * 100 > 90
584
+ for: 5m
585
+ labels:
586
+ severity: warning
587
+ annotations:
588
+ summary: "Redis out of memory (instance {{ $labels.instance }})"
589
+ description: "Redis is running out of memory ( {{ $value }}% )"
590
+ dashboard: "OVH:<MONITORING>/redis"
591
+
592
+ - alert: RedisRejectedConnections
593
+ expr: increase(redis_rejected_connections_total[1m]) > 0
594
+ for: 5m
595
+ labels:
596
+ severity: warning
597
+ annotations:
598
+ summary: "Redis rejected connections (instance {{ $labels.instance }})"
599
+ description: "Some connections to Redis has been rejected. Please check {{ $labels.app }}"
600
+ dashboard: "OVH:<MONITORING>/redis"
601
+
602
+ - name: Traefik Alerts
603
+ rules:
604
+ - alert: TraefikConfigReloadFailed
605
+ expr: traefik_config_last_reload_failure > 0
606
+ for: 1m
607
+ labels:
608
+ severity: warning
609
+ annotations:
610
+ summary: "Traefik config failed to reload"
611
+ description: "New config file for Traefik is invalid or Traefik encountered an error"
612
+
613
+ - alert: TraefikHighHttp4xxError
614
+ expr: sum(rate(traefik_service_requests_total{code=~"4.*"}[3m])) by (service) / sum(rate(traefik_service_requests_total[3m])) by (service) * 100 > 10
615
+ for: 5m
616
+ labels:
617
+ severity: error
618
+ annotations:
619
+ summary: "Traefik high HTTP 4xx error rate on {{ $labels.service }}"
620
+ description: "Traefik backend 4xx error rate is above 10% (currently at {{ $value }}%)"
621
+ dashboard: "OVH:<MONITORING>/traefik"
622
+
623
+ - alert: TraefikHighHttp5xxError
624
+ expr: sum(rate(traefik_service_requests_total{code=~"5.*"}[5m])) by (service) / sum(rate(traefik_service_requests_total[5m])) by (service) * 100 > 5
625
+ for: 5m
626
+ labels:
627
+ severity: page
628
+ priority: P3
629
+ annotations:
630
+ summary: "Traefik high HTTP 5xx error rate on {{ $labels.service }}"
631
+ description: "Traefik backend 5xx error rate is above 5% (currently at {{ $value }}%)"
632
+ dashboard: "OVH:<MONITORING>/traefik"
633
+
634
+ - name: Elasticsearch Alerts
635
+ rules:
636
+ - alert: ElasticsearchHeapUsageTooHigh
637
+ expr: (elasticsearch_jvm_memory_used_bytes{area="heap"} / elasticsearch_jvm_memory_max_bytes{area="heap"}) * 100 > 90
638
+ for: 5m
639
+ labels:
640
+ severity: page
641
+ priority: P3
642
+ annotations:
643
+ summary: "Elasticsearch Heap Usage Too High (instance {{ $labels.instance }})"
644
+ description: "The heap usage is over 90% for 5m (currently at {{ $value }}% )"
645
+ dashboard: "OVH:<MONITORING>/elasticsearch"
646
+
647
+ - alert: ElasticsearchHeapUsageWarning
648
+ expr: (elasticsearch_jvm_memory_used_bytes{area="heap"} / elasticsearch_jvm_memory_max_bytes{area="heap"}) * 100 > 80
649
+ for: 5m
650
+ labels:
651
+ severity: warning
652
+ annotations:
653
+ summary: "Elasticsearch Heap Usage warning (instance {{ $labels.instance }})"
654
+ description: "The heap usage is over 80% for 5m (currently at {{ $value }}% )"
655
+ dashboard: "OVH:<MONITORING>/elasticsearch"
656
+
657
+ - alert: ElasticsearchDiskSpaceLow
658
+ expr: elasticsearch_filesystem_data_available_bytes / elasticsearch_filesystem_data_size_bytes * 100 < 20
659
+ for: 5m
660
+ labels:
661
+ severity: warning
662
+ annotations:
663
+ summary: "Elasticsearch disk space low (instance {{ $labels.instance }})"
664
+ description: "The disk usage is over 80% (currently at {{ $value }}% )"
665
+ dashboard: "OVH:<MONITORING>/elasticsearch"
666
+
667
+ - alert: ElasticsearchDiskOutOfSpace
668
+ expr: elasticsearch_filesystem_data_available_bytes / elasticsearch_filesystem_data_size_bytes * 100 < 10
669
+ for: 5m
670
+ labels:
671
+ severity: page
672
+ priority: P3
673
+ annotations:
674
+ summary: "Elasticsearch disk out of space (instance {{ $labels.instance }})"
675
+ description: "The disk usage is over 90% (currently at {{ $value }}% )"
676
+ dashboard: "OVH:<MONITORING>/elasticsearch"
677
+
678
+ - alert: ElasticsearchClusterRed
679
+ expr: elasticsearch_cluster_health_status{color="red"} == 1
680
+ for: 5m
681
+ labels:
682
+ severity: error
683
+ annotations:
684
+ summary: "Elasticsearch Cluster Red (instance {{ $labels.instance }})"
685
+ description: "Elastic Cluster is in an unhealthy state"
686
+ dashboard: "OVH:<MONITORING>/elasticsearch"
687
+
688
+ - alert: ElasticsearchClusterYellow
689
+ expr: elasticsearch_cluster_health_status{color="yellow"} == 1
690
+ for: 5m
691
+ labels:
692
+ severity: warning
693
+ annotations:
694
+ summary: "Elasticsearch Cluster Yellow (instance {{ $labels.instance }})"
695
+ description: "Elastic Cluster is in an unhealthy state"
696
+ dashboard: "OVH:<MONITORING>/elasticsearch"
697
+
698
+ - alert: ElasticsearchRelocationShards
699
+ expr: elasticsearch_cluster_health_relocating_shards > 0
700
+ for: 5m
701
+ labels:
702
+ severity: error
703
+ annotations:
704
+ summary: "Elasticsearch relocation shards (instance {{ $labels.instance }})"
705
+ description: "Number of relocation shards for 20 min is {{ $value }}"
706
+ dashboard: "OVH:<MONITORING>/elasticsearch"
707
+
708
+ - alert: ElasticsearchInitializingShards
709
+ expr: elasticsearch_cluster_health_initializing_shards > 0
710
+ for: 5m
711
+ labels:
712
+ severity: warning
713
+ annotations:
714
+ summary: "Elasticsearch initializing shards (instance {{ $labels.instance }})"
715
+ description: "Number of initializing shards for 10 min is {{ $value }}"
716
+ dashboard: "OVH:<MONITORING>/elasticsearch"
717
+
718
+ - alert: ElasticsearchUnassignedShards
719
+ expr: elasticsearch_cluster_health_unassigned_shards > 0
720
+ for: 5m
721
+ labels:
722
+ severity: error
723
+ annotations:
724
+ summary: "Elasticsearch unassigned shards (instance {{ $labels.instance }})"
725
+ description: "Number of unassigned shards for 2 min is {{ $value }}"
726
+ dashboard: "OVH:<MONITORING>/elasticsearch"
727
+
728
+ - alert: ElasticsearchPendingTasks
729
+ expr: elasticsearch_cluster_health_number_of_pending_tasks > 0
730
+ for: 5m
731
+ labels:
732
+ severity: warning
733
+ annotations:
734
+ summary: "Elasticsearch pending tasks (instance {{ $labels.instance }})"
735
+ description: "Number of pending tasks for 10 min is {{ $value }}. Cluster is working slowly."
736
+ dashboard: "OVH:<MONITORING>/elasticsearch"
737
+ - name: Velero Alerts
738
+ rules:
739
+ - alert: VeleroBackupFailure
740
+ expr: (time() - velero_backup_last_successful_timestamp{schedule!=""} > 108000) and (velero_backup_success_total{schedule!=""} != 0)
741
+ for: 5m
742
+ labels:
743
+ severity: warning
744
+ annotations:
745
+ summary: "Velero schedule {{ $labels.schedule }} backup failed to execute properly"
746
+ description: "It has been over 30 hours since the last successful backup"
747
+ dashboard: "OVH:<MONITORING>/velero"
748
+ - alert: NoVeleroBackups
749
+ expr: velero_backup_success_total{schedule!=""} == 0
750
+ for: 5m
751
+ labels:
752
+ severity: warning
753
+ annotations:
754
+ summary: "Velero has not made any backups yet"
755
+ description: "Velero has been broken since cluster initialization because there is no successful backups around"
756
+ dashboard: "OVH:<MONITORING>/velero"
757
+
758
+ server:
759
+ affinity:
760
+ nodeAffinity:
761
+ preferredDuringSchedulingIgnoredDuringExecution:
762
+ - preference:
763
+ matchExpressions:
764
+ - key: cloud.google.com/gke-nodepool
765
+ operator: In
766
+ values:
767
+ - database
768
+ weight: 100
769
+ tolerations:
770
+ - key: "database"
771
+ operator: "Equal"
772
+ value: "true"
773
+ effect: "NoSchedule"
774
+ retention: "30d"
775
+ persistentVolume:
776
+ size: 50Gi
777
+ resources:
778
+ limits:
779
+ memory: 4Gi
780
+ requests:
781
+ memory: 2Gi
782
+ strategy:
783
+ type: Recreate
784
+
785
+ pushgateway:
786
+ enabled: false