Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Prometheus 在从活动状态更改为非活动状态之前,延迟普罗米修斯警报_Prometheus_Prometheus Alertmanager - Fatal编程技术网

Prometheus 在从活动状态更改为非活动状态之前,延迟普罗米修斯警报

Prometheus 在从活动状态更改为非活动状态之前,延迟普罗米修斯警报,prometheus,prometheus-alertmanager,Prometheus,Prometheus Alertmanager,我在我的普罗米修斯设置中有一个警报,当sometric>100在5m内有效时发送警报,然后根据以下配置每隔24小时重新发送警报: 普罗米修斯警报.yml - alert: TestAlert expr: someMetric > 100 for: 5m alertmanager config.yml repeat_interval: 24h 然而,someMetric有一种行为,它可以在100以上“稳定”(这意味着警报处于活动状态),但每隔一段

我在我的普罗米修斯设置中有一个警报,当
sometric>100
5m
内有效时发送警报,然后根据以下配置每隔
24小时重新发送警报:

普罗米修斯警报.yml

 - alert: TestAlert
          expr: someMetric > 100
          for: 5m
alertmanager config.yml

repeat_interval: 24h
然而,
someMetric
有一种行为,它可以在100以上“稳定”(这意味着警报处于活动状态),但每隔一段时间,它就会下降到100以下,以便进行一次刮擦,然后再跳回到100以上。这将导致活动警报变为非活动(已解决),然后在5分钟后返回挂起并再次激活。这将导致普罗米修斯重新发送警报,这正是我想要避免的

有没有一种方法可以将普罗米修斯配置为具有类似于:5m的
,但对于Transition active->inactive(已解决)?

在您的示例中,您可以使用其中一个promQL函数“过滤”掉下降到100以下的光点?在你的情况下,听起来max可能会工作?唯一不利的一面是,一旦警报值永久降至100以下,可能需要几分钟的时间才能结束警报

- alert: TestAlert
      expr: max_over_time(someMetric[2m]) > 100
      for: 5m