From 21bdf50266fe3d3be9e16e5a280adb5b9094699b Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 11 Mar 2024 08:40:10 +0000 Subject: [PATCH] Add an alert for mysql connection errors --- cookbooks/prometheus/templates/default/alert_rules.yml.erb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cookbooks/prometheus/templates/default/alert_rules.yml.erb b/cookbooks/prometheus/templates/default/alert_rules.yml.erb index 1fac68869..632fddc9f 100644 --- a/cookbooks/prometheus/templates/default/alert_rules.yml.erb +++ b/cookbooks/prometheus/templates/default/alert_rules.yml.erb @@ -421,6 +421,13 @@ groups: alertgroup: "{{ $labels.instance }}" annotations: connections_used: "{{ $value | humanizePercentage }}" + - alert: mysql connection errors + expr: increase(mysql_global_status_connection_errors_total[1m]) > 0 + for: 0m + labels: + alertgroup: "{{ $labels.instance }}" + annotations: + error_count: "{{ $value }}" - name: network rules: - alert: interface redundancy lost -- 2.39.5