1

Sometimes when looking at the AWS SQS Cloudwatch Metrics graphs like NumberOfMessagesSent, the graph plotted will show an actual data point at zero, and other times it won't show anything at all.

What is the difference between these two measures?

enter image description here

matt freake
  • 113
  • 4

1 Answers1

4

SQS queues essentially fall asleep and stop delivering metrics to CloudWatch after a few hours of total inactivity. There is no meaningful difference other than that. Since an empty, unused queue doesn't cost anything, and CloudWatch metrics for queues also don't cost anything, it would make sense to optimize-away the collection of monitoring data in that situation.

CloudWatch metrics 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. CloudWatch considers a queue to be active for up to six hours if it contains any messages or if any action accesses it.

https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-monitoring-using-cloudwatch.html

This is consistent with your observation, although I'm somewhat skeptical of the claim, made here, that CloudWatch is the entity that actually declares a queue inactive. I suspect this is a finger-pointing oversimplification, since it seems much more likely that SQS is where the determination originates. If I remember right, just opening SQS for the region on the console is enough to kick-start metrics reporting, and if you have even one consumer listening, the queue shouldn't get into this state.

Michael - sqlbot
  • 21,988
  • 1
  • 57
  • 81