我正在尝试在 Nomad 上运行 Prometheus。一切看起来都很好,但是当我添加带有模板的警报规则时annotations
它失败。
这是一个简单的警报规则:
groups:
- name: alertmanager.rules
rules:
- alert: AlertmanagerDown
expr: up{job="alertmanager"} == 0
for: 1s
labels:
severity: critical
annotations:
description: 'Alertmanager on {{ $labels.role }} instance {{ $labels.node }} has not produced any metrics for 5 minutes'
summary: 'Alertmanager is down on {{ $labels.role }} instance {{ $labels.node }}'
容器失败并显示Template: (dynamic): parse: template: :10: undefined variable "$labels"
如果我删除annotations
部分它开始没有任何问题。
必须设置left_delimiter
and right_delimiter
到除{{
and }}
https://www.nomadproject.io/docs/job-specification/template.html#left_delimiter https://www.nomadproject.io/docs/job-specification/template.html#left_delimiter
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)