我正在尝试在 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
部分,它会毫无问题地开始。