Skip to content

Commit 9b737df

Browse files
committed
chore: Adding initial mariadb alerts focused on replication status
1 parent f330dbb commit 9b737df

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
additionalPrometheusRulesMap:
2+
openstack-services-rabbitmq:
3+
groups:
4+
- name: mariadb-alerts
5+
rules:
6+
- alert: MariaDBDown
7+
expr: mysql_up != 1
8+
for: 5m
9+
labels:
10+
severity: critical
11+
annotations:
12+
summary: MariaDB not up and running, immediate attention is required.
13+
description: "MariaDB {{$labels.job}} on {{$labels.instance}} is not up."
14+
- alert: MysqlTooManyConnections(>80%)
15+
expr: max_over_time(mysql_global_status_threads_connected[1m]) / mysql_global_variables_max_connections * 100 > 80
16+
for: 2m
17+
labels:
18+
severity: warning
19+
annotations:
20+
summary: MySQL too many connections (> 80%) (instance {{ $labels.instance }})
21+
description: "More than 80% of MySQL connections are in use on {{ $labels.instance }}\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
22+
- alert: MariaDBReplicationErrors
23+
expr: mysql_slave_status_last_sql_errno != 0 or mysql_slave_status_last_io_errno != 0 or mysql_slave_status_last_errno != 0
24+
for: 5m
25+
labels:
26+
severity: critical
27+
annotations:
28+
summary: MariaDB is reporting replication errors from {{$labels.instance}}, immediate attention is required.
29+
description: "MariaDB {{$labels.job}} on {{$labels.instance}} is reporting replication errors."
30+
- alert: MysqlSlaveReplicationLag
31+
expr: ( (mysql_slave_status_seconds_behind_master - mysql_slave_status_sql_delay) and ON (instance) mysql_slave_status_master_server_id > 0 ) > 30
32+
for: 1m
33+
labels:
34+
severity: critical
35+
annotations:
36+
summary: MySQL Slave replication lag (instance {{ $labels.instance }})
37+
description: "MySQL replication lag on {{ $labels.instance }}\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
38+

0 commit comments

Comments
 (0)