how to create alert per error in stackdriver

拜拜、爱过 提交于 2019-12-22 08:50:11

问题


Having created log-based metrics in cloud console, I then want to create alerts so that every time there is a new matching log entry, the alert triggers.

In trying to create a suitable metric, the most likely looking options seem to be threshold or rate of change, but I don't think either will work for a policy of 1 log message => 1 alert.

Help appreciated.


回答1:


Yes, today the only way to alert on the log message is to create a threshold condition on the log metric with a very small threshold (0.001) and a duration of 1 minute. Thanks for using Stackdriver.




回答2:


You can use another alert triggering software (like PagerDuty) which is pinged by emails sent by Stackdriver. PagerDuty is able to filter all those emails that has the word RESOLVE in its subject. They can be absolutely thrown away in our case if you'd like to avoid autoresolving. Of course Stackdriver and PagerDuty alerts will diverge from each other (states will be inconsistent) but you should consider PD as single source of truth this time. It could be a possible workaround.



来源:https://stackoverflow.com/questions/38701568/how-to-create-alert-per-error-in-stackdriver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!