From 77fd92231135010795ac455641aff42afafa6052 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss <erdnaxe@crans.org>
Date: Thu, 13 Jun 2019 17:35:19 +0200
Subject: [PATCH] [prometheus] Add mount point and do not spam every 3h

---
 .../templates/prometheus/alertmanager.yml.j2                | 4 ++--
 roles/prometheus/templates/prometheus/alert.rules.yml.j2    | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/roles/prometheus-alertmanager/templates/prometheus/alertmanager.yml.j2 b/roles/prometheus-alertmanager/templates/prometheus/alertmanager.yml.j2
index 666c5ffc..bc957ae1 100644
--- a/roles/prometheus-alertmanager/templates/prometheus/alertmanager.yml.j2
+++ b/roles/prometheus-alertmanager/templates/prometheus/alertmanager.yml.j2
@@ -24,7 +24,7 @@ route:
   # This way ensures that you get multiple alerts for the same group that start
   # firing shortly after another are batched together on the first 
   # notification.
-  group_wait: 30s
+  group_wait: 1m
 
   # When the first notification was sent, wait 'group_interval' to send a batch
   # of new alerts that started firing for that group.
@@ -32,7 +32,7 @@ route:
 
   # If an alert has successfully been sent, wait 'repeat_interval' to
   # resend them.
-  repeat_interval: 3h 
+  repeat_interval: 12h 
 
   # A default receiver
   #receiver: team-roots-mails
diff --git a/roles/prometheus/templates/prometheus/alert.rules.yml.j2 b/roles/prometheus/templates/prometheus/alert.rules.yml.j2
index d2fafda5..4a93dbf3 100644
--- a/roles/prometheus/templates/prometheus/alert.rules.yml.j2
+++ b/roles/prometheus/templates/prometheus/alert.rules.yml.j2
@@ -33,8 +33,8 @@ groups:
     labels:
       severity: warning
     annotations:
-      summary: "Presque plus de stockage sur {{ $labels.instance }}"
-      description: "Le disque est presque rempli ({{ $value }}% restant)"
+      summary: "Presque plus de stockage sur {{ $labels.mountpoint }} sur {{ $labels.instance }}"
+      description: "La partition est presque remplie ({{ $value }}% restant)"
 
   # Alert for out of inode space on disk
   - alert: OutOfInodes
@@ -43,7 +43,7 @@ groups:
     labels:
       severity: warning
     annotations:
-      summary: "Presque plus d'inodes disque sur {{ $labels.instance }}"
+      summary: "Presque plus d'inodes disque sur {{ $labels.mountpoint }} sur {{ $labels.instance }}"
       description: "Le disque est presque à courre d'inodes disponibles ({{ $value }}% restant)"
 
   # Alert for high CPU usage
-- 
GitLab