From 6ec89b88d85a983246391a0f81d51d6082f7c954 Mon Sep 17 00:00:00 2001 From: Solal Nathan Date: Fri, 29 Jan 2021 19:33:38 +0100 Subject: [PATCH] Limit floats in alerts to 2 decimal places --- roles/prometheus/templates/prometheus/alert.rules.yml.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/prometheus/templates/prometheus/alert.rules.yml.j2 b/roles/prometheus/templates/prometheus/alert.rules.yml.j2 index 2a10358..6df102f 100644 --- a/roles/prometheus/templates/prometheus/alert.rules.yml.j2 +++ b/roles/prometheus/templates/prometheus/alert.rules.yml.j2 @@ -22,7 +22,7 @@ groups: labels: severity: warning annotations: - summary: "Mémoire libre de {{ $labels.instance }} à {{ $value }}%." + summary: "Mémoire libre de {{ $labels.instance }} à {{ $value | printf "%.2f" }}%." # Alert for out of disk space - alert: OutOfDiskSpace @@ -31,7 +31,7 @@ groups: labels: severity: warning annotations: - summary: "Espace libre de {{ $labels.mountpoint }} sur {{ $labels.instance }} à {{ $value }}%." + summary: "Espace libre de {{ $labels.mountpoint }} sur {{ $labels.instance }} à {{ $value | printf "%.2f" }}%." # Alert for out of inode space on disk - alert: OutOfInodes @@ -49,7 +49,7 @@ groups: labels: severity: warning annotations: - summary: "CPU sur {{ $labels.instance }} à {{ $value }}%." + summary: "CPU sur {{ $labels.instance }} à {{ $value | printf "%.2f" }}%." # Check systemd unit (> buster) - alert: SystemdServiceFailed