我正在使用Prometheus 2.5,并按照此处的测试教程https://prometheus.io/docs/prometheus/2.5/configuration/unit_testing_rules/
user@nb ~/Downloads/prometheus-2.5.0.linux-amd64 $ ./promtool check rules test.yml
Checking test.yml
FAILED:
yaml: unmarshal errors:
line 4: field rule_files not found in type rulefmt.RuleGroups
line 7: field evaluation_interval not found in type rulefmt.RuleGroups
line 9: field tests not found in type rulefmt.RuleGroups
我按照教程中的说明创建了alert.yml和test.yml。 不知道在哪里可以找到rulefmt.RuleGroups或如何更新它。
答案 0 :(得分:0)
check rules
是对规则文件的语法检查。您希望test rules
运行PromQL单元测试。