]> git.openstreetmap.org Git - chef.git/commitdiff
Improve alert readability
authorTom Hughes <tom@compton.nu>
Tue, 26 Jan 2021 22:25:24 +0000 (22:25 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 26 Jan 2021 22:30:18 +0000 (22:30 +0000)
cookbooks/prometheus/templates/default/alert_rules.yml.erb

index d2e076281dcdcc6f70f433a4d233414a5cb014e7..d870444ca41db0ba5be42d26786ed6ce8b2e1f80 100644 (file)
@@ -84,12 +84,12 @@ groups:
   - name: memory
     rules:
       - alert: low memory
-        expr: node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 10
+        expr: node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes < 0.1
         for: 5m
         labels:
           alertgroup: "{{ $labels.instance }}"
         annotations:
-          memory_free: "{{ $value }}%"
+          memory_free: "{{ $value | humanizePercentage }}"
       - alert: memory pressure
         expr: rate(node_vmstat_pgmajfault[1m]) > 1000
         for: 5m