user1692342
user1692342

Reputation: 5237

Cloudwatch set alarm if no message in sqs for an hour

Is there a way to alarm in cloudwatch when there is no message in SQS for a hour? I tried setting the following alarm:

Metric Name: NumberOfMessagesSent <= 0 for 60 datapoints within 1 hour
Statistic:SampleCount
Period:1 minute

However after 1 hour of no messages, it goes into the insufficient data alarm state. What am I doing wrong here?

Upvotes: 0

Views: 1304

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269081

Amazon SQS does not send metrics to Amazon CloudWatch if the queue empty.

Therefore, you should set your alarm to trigger when the state is INSUFFICIENT_DATA. This will effectively be the same as testing for an empty queue.

INSUFFICIENT_DATA

Upvotes: 1

Related Questions