From fea950ed284fb2038b38175afa4e76bb233f2699 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 8 Mar 2023 22:44:29 +0000 Subject: [PATCH] Scale some percentage values correctly in alerts --- cookbooks/prometheus/templates/default/alert_rules.yml.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbooks/prometheus/templates/default/alert_rules.yml.erb b/cookbooks/prometheus/templates/default/alert_rules.yml.erb index b0094a83b..f79438182 100644 --- a/cookbooks/prometheus/templates/default/alert_rules.yml.erb +++ b/cookbooks/prometheus/templates/default/alert_rules.yml.erb @@ -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 -- 2.39.5