]> git.openstreetmap.org Git - chef.git/commitdiff
Base site power alerts on a one hour rolling average
authorTom Hughes <tom@compton.nu>
Mon, 10 Apr 2023 15:04:05 +0000 (16:04 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 10 Apr 2023 15:04:05 +0000 (16:04 +0100)
cookbooks/prometheus/templates/default/alert_rules.yml.erb

index 440d2ac8b00d673502e4b1b5803ff77a146d8b56..8cf1776694f3f15573e49e32e4bbbe2b30e575f6 100644 (file)
@@ -11,7 +11,7 @@ groups:
         annotations:
           current: "{{ $value | humanize }}A"
       - alert: site power
-        expr: sum(rPDU2PhaseStatusApparentPower{site="amsterdam",rPDU2PhaseStatusIndex="1"} / 100) > 3
+        expr: sum(avg_over_time(rPDU2PhaseStatusApparentPower{site="amsterdam",rPDU2PhaseStatusIndex="1"}[1h]) / 100) > 3
         for: 6m
         labels:
           alertgroup: "amsterdam"
@@ -124,7 +124,7 @@ groups:
         annotations:
           current: "{{ $value | humanize }}A"
       - alert: site power
-        expr: sum(rPDU2PhaseStatusApparentPower{site="dublin",rPDU2PhaseStatusIndex="1"} / 100) > 4
+        expr: sum(avg_over_time(rPDU2PhaseStatusApparentPower{site="dublin",rPDU2PhaseStatusIndex="1"}[1h]) / 100) > 4
         for: 6m
         labels:
           alertgroup: "dublin"