DOP-C02 Monitoring and Logging Practice Question
A DevOps engineer needs to monitor the number of messages in an Amazon SQS queue and trigger an Auto Scaling policy to add more EC2 instances when the queue depth exceeds a threshold. Which CloudWatch metric should the alarm use?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
ApproximateNumberOfMessagesVisible
(ApproximateNumberOfMessagesVisible) is the correct metric because it represents the number of messages available to be retrieved from the queue. When this number exceeds a threshold, it indicates that consumer EC2 instances are not keeping up, so an Auto Scaling policy can add more instances to handle the load. Option A (NumberOfMessagesSent) is a count of messages sent, not the current queue depth. Option B (ApproximateNumberOfMessagesNotVisible) represents messages that are in flight (being processed) and not available for retrieval. Option D (SentMessageSize) is the size of messages sent, not the count. Therefore, C is correct.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
NumberOfMessagesSent
Why it's wrong here
NumberOfMessagesSent counts the total number of messages sent to the queue during a specified period, representing throughput rather than current queue depth. This metric increments over time and does not decrease when consumers read messages, so it cannot reflect the number of messages still waiting in the queue. A high NumberOfMessagesSent could occur even when the queue is empty if all messages were processed immediately, making it unsuitable for monitoring backlog.
- ✗
ApproximateNumberOfMessagesNotVisible
Why it's wrong here
ApproximateNumberOfMessagesNotVisible counts messages that are in flight (being processed by consumers) or delayed, not messages that are waiting to be processed. These messages are temporarily hidden from new receive requests, so they do not represent the immediate backlog. While this metric is useful for tracking consumer activity or message processing rates, it moves in the opposite direction of visible backlog and would give a misleading view of queue depth.
- ✓
ApproximateNumberOfMessagesVisible
Why this is correct
ApproximateNumberOfMessagesVisible is the correct CloudWatch metric for monitoring queue depth because it reports the number of messages available in the SQS queue for immediate retrieval by consumers. This value directly reflects the backlog of work waiting to be processed, making it the standard metric used for autoscaling consumers or triggering alarms. It is approximate due to SQS's distributed architecture, but it is polled frequently enough to provide a reliable real-time indicator of queue pressure.
- ✗
SentMessageSize
Why it's wrong here
SentMessageSize measures the size of each message sent to the queue in bytes, not the count of messages waiting to be processed. CloudWatch aggregates this as average, minimum, maximum, and total bytes, which may be useful for cost or payload optimization but provides no insight into the current number of messages in the queue. Monitoring this metric cannot tell you whether messages are accumulating or being drained, so it is irrelevant for backlog detection.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,013-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.