22

I have a cloudwatch alarm configured :

Threshold : "GreaterThan 0" for 1 consecutive period,

Period : 1 minute,

Statistic : Sum

The alarm is configured on top of AWS SQS NumberOfMessagesSent. The queue was empty and no messages were being published to it. I sent a message manually. I could see the spike in metric but state of alarm was still OK. I am a bit confused why this alarm is not changing its state even though all the conditions to trigger this are met.

3
  • do you have an action associated with the alarm? When did you look? the way this works is that it will go to ALARM and go back to OK in the next minute. So if you looked at the wrong time, or caught end of minute for reporting, it's possible that you did not observe it (but it happened)
    – Mircea
    Jul 9, 2015 at 20:12
  • I had attached an action for each of the state- ALARM, OK, INSUFFICIENT-STATE. The action was to send out email, but I did not receive any email either. Jul 10, 2015 at 4:33
  • 1
    @JuhiKulshreshtha - Facing the same problem. Did you figure out the solution? If yes, please share the same. Jun 20, 2016 at 8:37

3 Answers 3

14

I just overcame this problem with the help of AWS support. You need to set the period on your alarm to ~15 minutes. It's got to do with how SQS marks the event's timestamps as it pushes them to CloudWatch.

Don't worry, as setting the period to a greater number will not affect how quickly you are alerted of an alarm. It will still get data from SQS every 5 minutes.

5
  • 1
    Although very unintuitive, I can confirm that this works. Jul 18, 2017 at 19:51
  • 1
    I too can confirm
    – jecxjo
    Sep 20, 2017 at 21:17
  • 1
    I ran into this same issue today. For anyone else finding this, the answer above can now be improved upon (if you need it) by using the "M out of N" datapoints feature that has since been added. You can set a period of 5 minutes and "1 out of 2 datapoints", essentially getting your evaluation period at 10 minutes. As noted above, your alarm will still trigger within about 5 minutes of a message being sent to the queue, but since the eval period is 10 instead of 15 it will reset to OK about 5 minutes sooner than with a 15 minute period.
    – jstill
    Apr 17, 2018 at 18:40
  • by "set the period on your alarm to ~15 minutes" - does it mean the alarm will check the metric for every 15 mins so scaling can only be done at at least 15 mins interval? Also, when we set the period to 15 mins, do we need to adjust the metric value (eg.: NumberOfMessagesSent would be 3 times of the value we use for 5 mins)?
    – Arcobaleno
    Aug 13, 2019 at 2:39
  • FWIW I ran into this using the "AWS/ApiGateway" "5xx" error metric. When I changed the period to 15 minutes it worked. It also worked when I changed the period to 5 minutes and used "1 out of 2" Datapoints to alarm as per the comment by @jstill Jul 13, 2021 at 16:07
0

It could be that the interval time is set to less than 300 seconds. The free CloudWatch checks every 5 minutes so if you set an alarm for less than that it you will sometimes get INSUFFICIENT_DATA.

0

Sometimes they suffer something calling "Delayed Metric delivery", it's something more usual when the alarm period is around narrow times, like 1 minute.

When the delayed timestamp arrive, is too late for the alarm, but not for the graph, because it finally print it nicely without gap.

Play with Evalution Periods and Datapoints to Alarm, not 1/1, maybe 3/2 or 3/1 would work fine.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.