Skip to content

Commit b9da8fc

Browse files
a-velascopaulomach
andauthored
[DPE-5659] Update COS alert rules (#519)
* Changed description field to literal style Using `|` character for easier editing of multi-line strings in the description field. Each line break in the yaml represents a newline character. * Apply suggestions from code review Co-authored-by: Paulo Machado <[email protected]> * Update metrics_alert_rules.yaml * Update metrics_alert_rules.yaml Updates from a review meeting with Mohamed. * Adding 'K8s' to group name to match PostgreSQL --------- Co-authored-by: Paulo Machado <[email protected]>
1 parent 4457510 commit b9da8fc

File tree

1 file changed

+38
-23
lines changed

1 file changed

+38
-23
lines changed
Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
groups:
2-
- name: MySQLExporter
2+
- name: MySQLExporterK8s
33

44
rules:
55
# 2.1.1
@@ -9,8 +9,9 @@ groups:
99
labels:
1010
severity: critical
1111
annotations:
12-
summary: MySQL Down (instance {{ $labels.instance }})
13-
description: "MySQL instance is down\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
12+
summary: MySQL instance {{ $labels.instance }} is down.
13+
description: |
14+
LABELS = {{ $labels }}.
1415
1516
# 2.1.2
1617
# customized: 80% -> 90%
@@ -20,18 +21,10 @@ groups:
2021
labels:
2122
severity: warning
2223
annotations:
23-
summary: MySQL too many connections (> 90%) (instance {{ $labels.instance }})
24-
description: "More than 90% of MySQL connections are in use on {{ $labels.instance }}\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
25-
26-
# 2.1.3
27-
- alert: MySQLHighPreparedStatementsUtilization(>80%)
28-
expr: max_over_time(mysql_global_status_prepared_stmt_count[1m]) / mysql_global_variables_max_prepared_stmt_count * 100 > 80
29-
for: 2m
30-
labels:
31-
severity: warning
32-
annotations:
33-
summary: MySQL high prepared statements utilization (> 80%) (instance {{ $labels.instance }})
34-
description: "High utilization of prepared statements (>80%) on {{ $labels.instance }}\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
24+
summary: MySQL instance {{ $labels.instance }} is using > 90% of `max_connections`.
25+
description: |
26+
Consider checking the client application responsible for generating those additional connections.
27+
LABELS = {{ $labels }}.
3528
3629
# 2.1.4
3730
# customized: 60% -> 80%
@@ -41,8 +34,22 @@ groups:
4134
labels:
4235
severity: warning
4336
annotations:
44-
summary: MySQL high threads running (instance {{ $labels.instance }})
45-
description: "More than 80% of MySQL connections are in running state on {{ $labels.instance }}\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
37+
summary: MySQL instance {{ $labels.instance }} is actively using > 80% of `max_connections`.
38+
description: |
39+
Consider reviewing the value of the `max-connections` config parameter or allocate more resources to your database server.
40+
LABELS = {{ $labels }}.
41+
42+
# 2.1.3
43+
- alert: MySQLHighPreparedStatementsUtilization(>80%)
44+
expr: max_over_time(mysql_global_status_prepared_stmt_count[1m]) / mysql_global_variables_max_prepared_stmt_count * 100 > 80
45+
for: 2m
46+
labels:
47+
severity: warning
48+
annotations:
49+
summary: MySQL instance {{ $labels.instance }} is using > 80% of `max_prepared_stmt_count`.
50+
description: |
51+
Too many prepared statements might consume a lot of memory.
52+
LABELS = {{ $labels }}.
4653
4754
# 2.1.8
4855
# customized: warning -> info
@@ -52,8 +59,10 @@ groups:
5259
labels:
5360
severity: info
5461
annotations:
55-
summary: MySQL slow queries (instance {{ $labels.instance }})
56-
description: "MySQL server mysql has some new slow query.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
62+
summary: MySQL instance {{ $labels.instance }} has a slow query.
63+
description: |
64+
Consider optimizing the query by reviewing its execution plan, then rewrite the query and add any relevant indexes.
65+
LABELS = {{ $labels }}.
5766
5867
# 2.1.9
5968
- alert: MySQLInnoDBLogWaits
@@ -62,8 +71,11 @@ groups:
6271
labels:
6372
severity: warning
6473
annotations:
65-
summary: MySQL InnoDB log waits (instance {{ $labels.instance }})
66-
description: "MySQL innodb log writes stalling\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
74+
summary: MySQL instance {{ $labels.instance }} has long InnoDB log waits.
75+
description: |
76+
MySQL InnoDB log writes might be stalling.
77+
Check I/O activity on your nodes to find the responsible process or query. Consider using iotop and the performance_schema.
78+
LABELS = {{ $labels }}.
6779
6880
# 2.1.10
6981
- alert: MySQLRestarted
@@ -72,5 +84,8 @@ groups:
7284
labels:
7385
severity: info
7486
annotations:
75-
summary: MySQL restarted (instance {{ $labels.instance }})
76-
description: "MySQL has just been restarted, less than one minute ago on {{ $labels.instance }}.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
87+
summary: MySQL instance {{ $labels.instance }} restarted.
88+
description: |
89+
MySQL restarted less than one minute ago.
90+
If the restart was unplanned or frequent, check Loki logs (e.g. `error.log`).
91+
LABELS = {{ $labels }}.

0 commit comments

Comments
 (0)