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 {