google-cloud-platform - GCP 警报过滤器不会影响公开事件

标签 google-cloud-platform google-cloud-functions google-cloud-logging google-cloud-monitoring

我有一个警报,我已将其配置为在已完成状态而不是“错误”或“确定”的云函数的执行总和大于 0(按函数名称分组)时发送电子邮件。
我定义警报的方式是:
alert definition
二级聚合器是 delta .
问题是,一旦警报打开,过滤器看起来就不再重要了,并且警报保持打开状态,因为它看到云功能被触发并以任何状态结束(即使“正常”状态也保持打开状态)只要触发足够了)。
ATM 我能想到的唯一解决方案是定义一个基于日志的指标,该指标将自己计算,然后警报将基于该自定义指标而不是内置指标。
有什么我想念的吗?
编辑:
添加另一个图像以显示我认为可能存在的问题:
incident
从上图我们看到图表不会下降到 0 而是保持在 1,这不是其他正常事件的工作方式

最佳答案

根据official documentation :

"Monitoring automatically closes an incident when it observes that the condition is no longer met or when 7 days have passed without an observation that the condition is still being met."


这让我认为有时条件与关闭事件无关。已确认here :

"If measurements are missing (for example, if there are no HTTP requests for a couple of minutes), the policy uses the last recorded value to evaluate conditions."


缺少 HTTP 请求不是关闭指标的理由,因为它继续使用最后记录的值(触发指标)。
因此,对 Http 请求使用警报很好,但您需要自己关闭它们。虽然我认为如果您希望自动禁用它们,最好使用自定义指标。

关于google-cloud-platform - GCP 警报过滤器不会影响公开事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68064370/

相关文章:

google-cloud-platform - Vision API 话题性和得分始终相同

typescript - 如何在 js 文件上导入 ts 文件

google-cloud-platform - 如何通过日志查询获取最近1小时的日志结果?

go - Go 中来自 GCF 的日志不包含日志级别

javascript - 如何以 JSON 形式发送 Google 云平台的 Windows key ?

google-cloud-platform - 我可以使用 Google Cloud Platform 在一处监控多个项目吗?

google-cloud-platform - GCP 发布订阅 : "The request was aborted because there was no available instance." - Doesn't Retry on Failure

python - 在 kubernetes 中写入日志

ssh - 使用谷歌 gcloud ssh 隧道进入网络内部的 linux 机器

google-app-engine - 如何在 Google Cloud Functions 和 Google App Engine 之间做出选择?