From 5333cc9770344456d5a3ce22e46186ffb1e36b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 7 Dec 2020 12:43:15 +0100 Subject: [PATCH] add more parameters to configure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- defaults/main.yml | 6 ++++++ templates/alertmanager.yml.j2 | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 43d348d..103379d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -20,6 +20,12 @@ alertmanager_domain: ~ alertmanager_url: 'https://{{ alertmanager_domain | mandatory }}/' alertmanager_admin_email: ~ +# Route configuration +alertmanager_group_by: ['alertname', 'cluster'] +alertmanager_group_wait: '30s' +alertmanager_group_interval: '3m' +alertmanager_repeat_interval: '1h' + # VictorOps paging service alertmanager_victorops_api_key: ~ alertmanager_victorops_service_url: ~ diff --git a/templates/alertmanager.yml.j2 b/templates/alertmanager.yml.j2 index 8af83fa..0c4df42 100644 --- a/templates/alertmanager.yml.j2 +++ b/templates/alertmanager.yml.j2 @@ -1,3 +1,4 @@ +--- global: # SMTP authentication information. smtp_from: '{{ alertmanager_smtp_from }}' @@ -13,13 +14,13 @@ route: # Default destination fo all alerts receiver: 'admin-email' # How to group together alerts - group_by: ['alertname', 'cluster'] + group_by: {{ alertmanager_group_by | to_yaml }} # Wait this much before initial notification to group them. - group_wait: 30s + group_wait: '{{ alertmanager_group_wait }}' # Wait before sending another batch for a group. - group_interval: 3m + group_interval: '{{ alertmanager_group_interval }}' # Wait this much to resend notifications. - repeat_interval: 1h + repeat_interval: '{{ alertmanager_repeat_interval }}' routes: # send all notifications to slack too