Creating CloudWatch alarms for Amazon SQS metrics
CloudWatch lets you trigger alarms based on a metric threshold. For example, you can
create an alarm for the NumberOfMessagesSent
metric. For example, if
more than 100 messages are sent to the MyQueue
queue in 1 hour, an
email notification is sent out. For more information, see Creating Amazon CloudWatch Alarms in
the Amazon CloudWatch User Guide.
Sign in to the AWS Management Console and open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/
. -
Choose Alarms, and then choose Create Alarm.
-
In the Select Metric section of the Create Alarm dialog box, choose Browse Metrics, SQS.
-
For SQS > Queue Metrics, choose the QueueName and Metric Name for which to set an alarm, and then choose Next. For a list of available metrics, see Available CloudWatch metrics for Amazon SQS.
In the following example, the selection is for an alarm for the
NumberOfMessagesSent
metric for theMyQueue
queue. The alarm triggers when the number of sent messages exceeds 100. -
In the Define Alarm section of the Create Alarm dialog box, do the following:
-
Under Alarm Threshold, type the Name and Description for the alarm.
-
Set is to > 100.
-
Set for to 1 out of 1 datapoints.
-
Under Alarm preview, set Period to 1 Hour.
-
Set Statistic to Standard, Sum.
-
Under Actions, set Whenever this alarm to State is ALARM.
If you want CloudWatch to send a notification when the alarm is triggered, select an existing Amazon SNS topic or choose New list and enter email addresses separated by commas.
Note
If you create a new Amazon SNS topic, the email addresses must be verified before they receive any notifications. If the alarm state changes before the email addresses are verified, the notifications aren't delivered.
-
-
Choose Create Alarm.
The alarm is created.