Support for statement in alerts.

This commit is contained in:
Michael Kutý 2017-05-16 09:41:06 +02:00
parent 2780f793b7
commit 5387f75417
2 changed files with 4 additions and 0 deletions

View file

@ -59,6 +59,7 @@ Configure prometheus server
alert:
PrometheusTargetDown:
if: 'up != 1'
for: 5m
labels:
severity: down
annotations:

View file

@ -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 {