简体   繁体   English

Google Cloud 日志记录,仅针对新出现的错误发送 Slack 通知

[英]Google Cloud logging, sending slack notifications only for newly appeared errors

need to send alerts to slack using google cloud logging but send the alert only once, because the alert may be repeated multiple times and this will cause a lot of miss.需要使用谷歌云日志向 slack 发送警报,但只发送一次警报,因为警报可能会重复多次,这会导致很多错过。

I think to resolve your issue, in addition to the filter for the log based metric , you should add labels with extractors.我认为要解决您的问题,除了log based metric的过滤器之外,您还应该添加带有提取器的labels

The metric is checked for each labels and not once.为每个标签检查指标,而不是一次。

在此处输入图像描述

In my example I added a log based metric with a filter for some error types in Cloud Composer .在我的示例中,我为Cloud Composer中的某些错误类型添加了一个log based metric和过滤器。 In order to increment my metric and make be unique, I also added labels on the current Airflow task id and execution date .为了增加我的指标并使其独一无二,我还在当前Airflow task idexecution date上添加了标签。

Then I just need to create an alerting policy on this log based metric with a treshold.然后我只需要在这个基于日志的指标上创建一个警报策略,并设置一个阈值。

If I don't add labels and extractor, my alert is fired only once.如果我不添加标签和提取器,我的警报只会触发一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Load Balancer 不记录错误 - Google Load Balancer not logging errors 用于删除重复项的 Google Cloud Logging 过滤器 - Google Cloud Logging filter to remove duplicates 谷歌云日志python脚本权限错误 - Google cloud logging python script permission error GCP slack 教程“斜杠命令”; 未能部署谷歌云功能 - GCP slack tutorial 'slash command'; failed to deploy google cloud function 如何使用 terraform 在 Google Cloud Platform 中创建松弛通知通道 - How to create a slack notification channel in Google Cloud Platform with terraform Google Cloud Console 日志记录中的正则表达式 - Regular Expressions in Google Cloud Console Logging Dialogflow Google Cloud 更改日志记录设置的权限 - Dialogflow Google Cloud permissions to change logging settings Google Cloud 和 Firebase:为什么 Python 打印不再用于日志记录? - Google Cloud and Firebase: Why does Python print not work anymore for logging? 如何调试 Google Cloud Functions 中的 Axios 错误? - How to debug Axios Errors in Google Cloud Functions? 发送 Email 在 Google Cloud Run 中不起作用 - Sending out Email is not working at Google Cloud Run
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM