简体   繁体   English

适用于SQS的AWS CloudWatch警报消息数量可见

[英]AWS CloudWatch alarm for SQS Number of Messages Visible

I am trying to capture the event of a new message in my FIFO queue (as I want to avoid , infinite polling of Queue) . 我正在尝试在FIFO队列中捕获新消息的事件(如我想避免的那样,是对Queue的无限轮询)。

For this purpose I am evaluating the CloudWatch alarm option with metrics ApproximateNumberOfMessagesVisible . 为此,我正在使用指标NumberNumberOfMessagesVisible评估CloudWatch警报选项。

Following is my Alarm description- 以下是我的警报说明-

Threshold : The condition in which the alarm will go to the ALARM state.ApproximateNumberOfMessagesVisible >= 0 for 1 minute 阈值 :警报将进入ALARM状态的状态。大约1分钟内NumberOfMessagesVisible> = 0

Actions :The actions that will occur when the alarm changes state. 操作 :警报更改状态时将发生的操作。 In ALARM: 在警报中:
Send message to topic "topic_for_events_generated_bycloudwatch" (xyz@xyz) Send message to topic "topic_for_events_generated_bycloudwatch" 将消息发送到主题“ topic_for_events_genic_bycloudwatch”(xyz @ xyz)将消息发送到主题“ topic_for_events_generation_bycloudwatch”

Period :The granularity of the datapoints for the monitored metric.1 minute 周期 :监视的指标的数据点的粒度。1分钟

Following are my queries - 以下是我的查询-

  1. Assuming there are more than 0 messages in the given Q - will this alarm raised only once when the condition met or every minute ? 假设给定Q中的消息多于0,则在满足条件时或每分钟仅发出一次此警报吗?
  2. During quick test I saw Alarm keeping moving between INSUFFICIENT and ALARM state in random other without any configuration changes, what could be rational ? 在快速测试中,我看到了警报在INSUFFICICIENT和ALARM状态之间保持随机变化,而没有任何配置更改,这可能是合理的吗?

Screenshot of ApproximateNumberOfMessagesVisible metric graph Screenshot of the log activity 近似数字OfMessagesVisible指标图的 屏幕截图日志活动的屏幕截图

Thanks in advance. 提前致谢。

Regards, Rohan K 此致Rohan K

Cloudwatch will alarm once the threshold is breached for state transition. 一旦超出阈值进行状态转换,Cloudwatch将发出警报。

From the Docs 来自文档

Alarms invoke actions for sustained state changes only. 警报仅针对持续状态更改调用操作。 CloudWatch alarms do not invoke actions simply because they are in a particular state, the state must have changed and been maintained for a specified number of periods. CloudWatch警报不会仅仅因为它们处于特定状态而调用操作,该状态必须已更改并维持指定的时间段。

But

After an alarm invokes an action due to a change in state, its subsequent behavior depends on the type of action that you have associated with the alarm. 警报由于状态更改而调用操作后,其后续行为取决于与该警报关联的操作类型。 For Amazon EC2 and Auto Scaling actions, the alarm continues to invoke the action for every period that the alarm remains in the new state. 对于Amazon EC2和Auto Scaling操作,在警报保持新状态的每个时间段,警报都会继续调用该操作。 For Amazon SNS notifications, no additional actions are invoked. 对于Amazon SNS通知,不会调用其他操作。

An Example: 一个例子:

In the following figure, the alarm threshold is set to 3 units and the alarm is evaluated over 3 periods. 在下图中,警报阈值设置为3个单位,并在3个周期内评估警报。 That is, the alarm goes to ALARM state if the oldest of the 3 periods being evaluated is breaching, and the 2 subsequent periods are either breaching or missing. 即,如果要评估的3个时段中最旧的时段被违反,而随后的2个时段被违反或丢失,则警报将进入ALARM状态。 In the figure, this happens with the third through fifth time periods, and the alarm's state is set to ALARM. 在图中,这发生在第三到第五时间段,并且警报的状态设置为ALARM。 At period six, the value dips below the threshold, and the state reverts to OK. 在周期6,该值降至阈值以下,状态恢复为OK。 Later, during the ninth time period, the threshold is breached again, but for only one period. 后来,在第九个时间段内,再次突破了阈值,但仅持续了一个时间段。 Consequently, the alarm state remains OK. 因此,警报状态保持正常。

在此处输入图片说明

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM