如果指标停止出现,Prometheus 警报会发生什么情况?

What happens to Prometheus alerts if metrics stop coming?

我有这样的 Prometheus 警报:

ALERT etcdNoLeader
    IF etcd_server_has_leader{job="etcd"} == 0
    FOR 1m

如果 etcd_server_has_leader 指标停止生成数据会怎样? 警报是否触发?它有什么作用吗?

警报将停止触发。您通常需要 up == 0 上的警报,并且根据您的设置可能还 absent(up).