]> git.openstreetmap.org Git - chef.git/commitdiff
Add some mysql alerts
authorTom Hughes <tom@compton.nu>
Sat, 31 Dec 2022 12:02:00 +0000 (12:02 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 31 Dec 2022 12:02:00 +0000 (12:02 +0000)
cookbooks/prometheus/templates/default/alert_rules.yml.erb

index 34a33d374ea1de8d9a385c724f05a573a8ea9a08..6c8078e45e1310905342029197e303d2c2ac7073 100644 (file)
@@ -337,6 +337,20 @@ groups:
           alertgroup: "{{ $labels.instance }}"
         annotations:
           new_oom_kills: "{{ $value }}"
+  - name: mysql
+    rules:
+      - alert: mysql down
+        expr: mysql_up == 0
+        for: 1m
+        labels:
+          alertgroup: "{{ $labels.instance }}"
+      - alert: mysql connection limit
+        expr: mysql_global_status_max_used_connections / mysql_global_variables_max_connections > 0.8
+        for: 1m
+        labels:
+          alertgroup: "{{ $labels.instance }}"
+        annotations:
+          connections_used: "{{ $value | humanizePercentage }}"
   - name: network
     rules:
       - alert: interface transmit rate