I tried to create a AWS Alarm to watch the SQS. If the queue has more than 1 message for 2 minutes, I want to create an alarm to trigger a policy. I used this command to create the alarm:
aws cloudwatch put-metric-alarm --alarm-name alarmName --metric-name ApproximateNumberOfMessagesVisible --namespace "AWS/SQS" --statistic Average --period 60 --evaluation-periods 2 --threshold 1 --comparison-operator GreaterThanOrEqualToThreshold --dimensions "Name=QueueName,Value=QueueName" "Name=AutoScalingGroupName,Value=asg-name" --alarm-actions "<arn:batch-upscale-policy>" --actions-enable
I can see the alarm in the AWS console, but it's stuck in the INSUFFICIENT_DATA
state. How can I fix it?
Here I'm to listen to queues in other AWS Account. Is it possible??!
Because the data points are not successfully being delivered to CloudWatch, the alarm can't retrieve any data points for those evaluation periods. This triggers an INSUFFICIENT_DATA state. After recovering connectivity, the application sends the backlog of data points, each one with its own timestamp.
Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/ . In the navigation pane, choose Alarms. Select the check box to the left of the name of the alarm, and choose Actions, Delete.
If your CloudWatch alarm is in the INSUFFICIENT_DATA, it can indicate any one of the following reasons: An Amazon CloudWatch alarm has just started. The metric is not available. There is insufficient data for the metric to establish the alarm state.
Alarm history is available for 14 days. To view your alarm history, log in to CloudWatch in the Amazon Web Services Management Console, choose Alarms from the menu at left, select your alarm, and click the History tab in the lower panel.
What you are seeing is normal, if you don't already have a process running that is polling the queue. You have to have something running that will at least periodically poll the queue, and the insufficient data condition should then clear itself. SQS sends nothing to cloudwatch if the queue has no producers or consumers for approximately 6 hours.
The metrics you configure with CloudWatch for your Amazon SQS queues are automatically collected and pushed to CloudWatch every five minutes. These metrics are gathered on all queues that meet the CloudWatch guidelines for being active. A queue is considered active by CloudWatch for up to six hours from the last activity (i.e., any API call) on the queue.
http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/MonitorSQSwithCloudWatch.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With