Orders are processed through SQS. How do you detect that consumers are falling behind?
BeginnerScenarioCloud Monitoring, Incidents and Migrations
Answer
Situation read → Queue depth alone can be misleading during bursts; message age shows real delay.
What I'd do →
- Alarm on
ApproximateAgeOfOldestMessage(Maximum) above your processing SLO, e.g. 300 s for 10 minutes. - Watch
ApproximateNumberOfMessagesVisiblefor trends and capacity planning. - Alarm on the DLQ:
ApproximateNumberOfMessagesVisible > 0. - Scale consumers on queue depth (KEDA
aws-sqs-queuescaler or ECS target tracking).
aws cloudwatch put-metric-alarm --alarm-name orders-queue-age \
--namespace AWS/SQS --metric-name ApproximateAgeOfOldestMessage \
--dimensions Name=QueueName,Value=orders --statistic Maximum \
--period 60 --evaluation-periods 10 --threshold 300 \
--comparison-operator GreaterThanThreshold \
--alarm-actions arn:aws:sns:eu-west-1:111122223333:oncall
Why → Age expresses customer impact directly: "orders are 5 minutes late".
Interview tip → Mention that a poisoned message can block FIFO queues; DLQ alerts catch it.
More on Cloud Monitoring, Incidents and Migrations
A new AWS workload uses EC2, an ALB and RDS, with only CloudWatch available. Which alarms do you create first?BeginnerThe CloudWatch bill jumped from $2k to $15k a month. How do you find and cut the cost?IntermediateYour company has 50 AWS accounts. How do you get one monitoring view?IntermediateYour team uses Prometheus and Grafana, but RDS, SQS and ALB metrics live only in CloudWatch. How do you unify?IntermediateHow do you monitor a fleet of AWS Lambda functions?BeginnerYour RDS PostgreSQL database gets slow every afternoon. What monitoring do you use to find out why?Beginner