]> git.openstreetmap.org Git - chef.git/commitdiff
Scale some percentage values correctly in alerts
authorTom Hughes <tom@compton.nu>
Wed, 8 Mar 2023 22:44:29 +0000 (22:44 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 8 Mar 2023 22:44:29 +0000 (22:44 +0000)
cookbooks/prometheus/templates/default/alert_rules.yml.erb

index b0094a83b24869ba8e5555751b45e5f1418135c3..f794381820a4c7971e566990c264b877cf832aa4 100644 (file)
@@ -578,7 +578,7 @@ groups:
         labels:
           alertgroup: "{{ $labels.instance }}"
       - alert: smart ssd wearout approaching
-        expr: smart_percentage_used >= 80
+        expr: smart_percentage_used / 100 >= 0.8
         for: 60m
         labels:
           alertgroup: "{{ $labels.instance }}"
@@ -587,7 +587,7 @@ groups:
   - name: smokeping
     rules:
       - alert: packet loss
-        expr: 100 - (rate(smokeping_response_duration_seconds_count[5m]) * 100 / rate(smokeping_requests_total[5m])) > 0
+        expr: 1 - (rate(smokeping_response_duration_seconds_count[5m]) / rate(smokeping_requests_total[5m])) > 0
         for: 5m
         labels:
           alertgroup: smokeping