Skip to content

Commit

Permalink
Added prepared statements mysqld-exporter alert (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonPerinon authored Mar 26, 2024
1 parent 85b102d commit 2494ccd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions _data/rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,11 @@ groups:
query: "max_over_time(mysql_global_status_threads_connected[1m]) / mysql_global_variables_max_connections * 100 > 80"
severity: warning
for: 2m
- name: MySQL high prepared statements utilization (> 80%)
description: "High utilization of prepared statements (>80%) on {{ $labels.instance }}"
query: "max_over_time(mysql_global_status_prepared_stmt_count[1m]) / mysql_global_variables_max_prepared_stmt_count * 100 > 80"
severity: warning
for: 2m
- name: MySQL high threads running
description: "More than 60% of MySQL connections are in running state on {{ $labels.instance }}"
query: "max_over_time(mysql_global_status_threads_running[1m]) / mysql_global_variables_max_connections * 100 > 60"
Expand Down
9 changes: 9 additions & 0 deletions dist/rules/mysql/mysqld-exporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ groups:
summary: MySQL too many connections (> 80%) (instance {{ $labels.instance }})
description: "More than 80% of MySQL connections are in use on {{ $labels.instance }}\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: MySQL high prepared statements utilization (> 80%)
expr: 'max_over_time(mysql_global_status_prepared_stmt_count[1m]) / mysql_global_variables_max_prepared_stmt_count * 100 > 80'
for: 2m
labels:
severity: warning
annotations:
summary: MySQL high prepared statements utilization (> 80%) (instance {{ $labels.instance }})
description: "High utilization of prepared statements (>80%) on {{ $labels.instance }}\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: MysqlHighThreadsRunning
expr: 'max_over_time(mysql_global_status_threads_running[1m]) / mysql_global_variables_max_connections * 100 > 60'
for: 2m
Expand Down

0 comments on commit 2494ccd

Please sign in to comment.