DOP-C02 Monitoring and Logging Practice Question
A company runs a fleet of EC2 instances behind an Auto Scaling group. The DevOps team wants to detect and respond to memory leaks in their application. They have configured CloudWatch agent to collect memory metrics. However, the metric shows unpredictable spikes. The team needs to correlate these spikes with application logs to identify the root cause. Which solution provides the BEST correlation?
⚠ Common exam trap
It's easy for candidates to confuse AWS X-Ray's request tracing with OS-level metric correlation, or assume that exporting to S3 and using Athena is a universal solution, when in fact CloudWatch Logs Insights provides the most direct and efficient correlation within the same monitoring ecosystem.
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
✓
Use CloudWatch Logs Insights to query application logs for error patterns around the time of memory spikes
CloudWatch Logs Insights allows you to query application logs directly in CloudWatch Logs using a purpose-built query language. By filtering logs around the timestamps of memory spikes, you can correlate specific error patterns or log entries with the metric data, enabling root cause analysis without moving data or adding complexity.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Export the memory metric and application logs to Amazon S3 and use Amazon Athena to join them
Why it's wrong here
Exporting CloudWatch Logs to S3 and querying with Athena is inherently batch-oriented; a Logs export task can take up to 12 hours to deliver, so this approach lacks the real-time visibility needed to respond to active memory spikes. Additionally, joining memory metrics with logs in Athena requires manually aligning timestamps across separate export files, and Athena's per-query processing adds latency that is impractical for interactive troubleshooting.
- ✗
Enable AWS X-Ray on the application to trace requests and identify memory-heavy requests
Why it's wrong here
AWS X-Ray is designed for distributed tracing of application requests, capturing segments and subsegments, but it does not collect or expose EC2 instance memory utilization by default. While you can propagate custom metadata or annotations, correlating those traces with CloudWatch memory metrics requires building a custom reporting pipeline, and memory spikes from background processes or garbage collection would remain invisible if you only trace incoming requests.
- ✓
Use CloudWatch Logs Insights to query application logs for error patterns around the time of memory spikes
Why this is correct
CloudWatch Logs Insights provides a queryable index of live application logs, so you can run interactive queries that filter for ERROR, FATAL, or exception patterns within the exact time window of a memory spike. Using the parse command on structured logs and grouping by timestamp or host, you can quickly identify a correlated error or log burst, making it the appropriate tool for real-time operational correlation between CloudWatch metrics and log data.
- ✗
Use Amazon EventBridge to capture EC2 instance state changes and correlate with memory spikes
Why it's wrong here
Amazon EventBridge is a serverless event bus that reacts to AWS service events, such as EC2 instance state-change notifications or CloudWatch alarm state transitions, but it does not ingest or analyze application log content. Instance state changes rarely coincide with memory pressure, since an instance can remain 'running' while memory usage climbs; using EventBridge alone would only allow you to trigger a response, not to perform the correlation needed to understand the spike's root cause.
Go deeper
Related to this question
About these practice questions
One of 1,013 original DOP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.