【发布时间】:2020-05-28 07:04:42
【问题描述】:
在我的 prometheus.yml 中,规则文件被称为 rules.yml,它有这个
---
groups:
- name: example
rules:
- alert: ServiceDown
expr: up == 0
for: 2m
labels:
severity: critical
annotations:
summary: cannot connect to {{ $labels.job }}
当我运行 sudo ./promtool check config rules.yml 我得到错误
Checking rules.yml
FAILED: parsing YAML file rules.yml: yaml: unmarshal errors:
line 2: field groups not found in type config.plain
我不知道出了什么问题,因为我正在关注这个https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/
Prometheus 版本是 2.18.1
希望有人帮忙
谢谢 KK
【问题讨论】:
标签: prometheus prometheus-alertmanager