AWS CloudWatch的心跳报警 [英] AWS Cloudwatch Heartbeat Alarm

查看:1365
本文介绍了AWS CloudWatch的心跳报警的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,将一个自定义的CloudWatch指标AWS的每一分钟。这应该作为一个心跳,所以我知道该应用程序是活的。

I have an app that puts a custom Cloudwatch metric to AWS every minute. This is supposed to act as a heartbeat so I know the app is alive.

现在我希望把闹钟在这个指标如果心跳停止通知我。我曾尝试使用不同的CloudWatch报警统计数据,包括平均和数据样本,并设置一个报警阈值小于1在给定的时间来完成。然而,在所有情况下,如果我的应用程序死亡,停止报告心跳,报警只会进入一个数据不足状态,并且永远不会成为一个报警状态。

Now I want to put an alarm on this metric to notify me if the heartbeat stops. I have tried to accomplish this using different cloudwatch alarm statistics including "average" and "data samples" and setting an alarm threshold less than 1 over a given period. However, in all cases, if my app dies and stops reporting the heartbeat, the alarm will only go into an "Insufficient Data" state and never into an "Alarm" state.

我明白我可以把通知上的数据不足的状态,但我想这显示为报警。这是可能的CloudWatch的?

I understand I can put a notification on the "Insufficient Data" state, but I want this to show up as an alarm. Is this possible in Cloudwatch?

谢谢

推荐答案

而不是在自定义指标推到CloudWatch的,可以考虑:

Instead of pushing in a custom metric to Cloudwatch, consider:

推一个消息到一个SNS的话题,相同的周期性基础上,你在做什么,并成立了CloudWatch的显示器为SNS主题的NumberOfMessagesPublished指标。如果心跳的次数低于预期值的时间段指定,其是否因为应用程序崩溃或服务器崩溃,该指标将进入报警状态。

Push a message onto an SNS topic, on the same periodic basis as you were doing, and set up a CloudWatch monitor for the SNS topic's NumberOfMessagesPublished metric. If the number of heartbeats falls below the expected value for the time period you specify, whether its because the app crashed, or server crashed, the metric will go into an Alarm state.

这篇关于AWS CloudWatch的心跳报警的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆