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

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

问题描述

我有一个应用程序,每分钟向 AWS 发送一个自定义 Cloudwatch 指标.这应该作为心跳,所以我知道应用程序是活跃的.

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?

谢谢,

马特

推荐答案

我认为进入数据不足"状态的警报与处理缺失数据的方式有关.正如 doc 所述:

I think that the alarm going into "Insufficient Data" state has to do with how missing data is being handled. As the doc states:

类似于每个警报始终处于三种状态之一,报告给 CloudWatch 的每个特定数据点都属于以下三个类别之一:

Similar to how each alarm is always in one of three states, each specific data point reported to CloudWatch falls under one of three categories:

  • 未违反(在阈值内)
  • 违反(违反门槛)
  • 缺少

您可以指定警报处理缺失数据点的方式.选择是否将缺失数据点视为:

You can specify how alarms handle missing data points. Choose whether to treat missing data points as:

  • 丢失(警报会及时回溯以查找其他数据点)
  • notBreaching(视为阈值内的数据点)
  • 违反(视为违反阈值的数据点)
  • 忽略(保持当前警报状态)

默认行为是缺失.

所以我想将缺失的数据点指定为违反就可以了:)

So i guess that specifying missing data points as breaching would do the trick :)

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

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