Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我开始使用promtool test rules. 基本测试有效,但我还想编写测试来检查警报是否没有针对特定系列的值触发。
promtool test rules
这可能吗?我将如何表达这样的测试?
我想我已经想通了。
只需在测试中提供一个空的 exp_alerts :
evaluation_interval: 1m tests: - interval: 10s input_series: - series: '...' values: '...' alert_rule_test: - eval_time: 10m alertname: my_alert exp_alerts:
如果没有警报,这将通过,如果警报触发,则会失败。