operator
operator copied to clipboard
vmalert: add template variable to hold the "for:" alert rule value
It would be nice to be able to include
- alert: InstanceDown
expr: up == 0
for: 5m
labels:
severity: page
annotations:
description: '{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.'
summary: 'Instance {{ $labels.instance }} down'
E.g. allow something like this:
description: '{{ $labels.instance }} of job {{ $labels.job }} has been down for more than {{ $for }}.'
Thoughts?
Hello, it should be already possible to use the value of for field from alerting rule, in this case it should be 5m.
For the actual firing state of alert, it's recommended to use value of StartsAt field at alertmanager
https://prometheus.io/docs/alerting/latest/notifications/#alert
Apologies - but at the link you gave I am not seeing "for" as an option. Should I raise it with prometheus guys?
hey @rcowham
$for is available as template variable
please check a list of variables here
https://docs.victoriametrics.com/victoriametrics/vmalert/#templating