From 5387f75417e828de7d2461e431502affa4f5e4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Kut=C3=BD?= <6du1ro.n@gmail.com> Date: Tue, 16 May 2017 09:41:06 +0200 Subject: [PATCH] Support for statement in alerts. --- README.rst | 1 + prometheus/files/alerts.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.rst b/README.rst index c1f02d8..2a445eb 100644 --- a/README.rst +++ b/README.rst @@ -59,6 +59,7 @@ Configure prometheus server alert: PrometheusTargetDown: if: 'up != 1' + for: 5m labels: severity: down annotations: diff --git a/prometheus/files/alerts.yml b/prometheus/files/alerts.yml index 97d0dde..89792bc 100644 --- a/prometheus/files/alerts.yml +++ b/prometheus/files/alerts.yml @@ -31,6 +31,9 @@ {%- if alert.get('enabled', True) %} ALERT {{ alertname }} IF {{ alert.if }} + {%- if alert.for is defined %} + FOR {{ alert.for }} + {%- endif %} {%- if alert.for is defined %}FOR {{ alert.for }}{%- endif %} {%- if alert.labels is defined %} LABELS {