DOP-C02 Monitoring and Logging Practice Question
A DevOps engineer is designing a monitoring solution for an application that runs on Amazon EC2 instances in an Auto Scaling group. The engineer needs to collect memory utilization metrics and visualize them in a dashboard. What should the engineer do?
⚠ Common exam trap
DOP-C02 often tests the difference between default and custom metrics; the trap is assuming that detailed monitoring includes memory, or that CloudTrail can capture resource utilization, when in fact only the CloudWatch agent can provide memory metrics.
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
✓
Install the Amazon CloudWatch agent on the EC2 instances to collect memory metrics and publish them to CloudWatch.
The Amazon CloudWatch agent is required to collect memory utilization metrics from EC2 instances because memory usage is not a default metric provided by CloudWatch. By installing the CloudWatch agent on the instances, it can gather memory metrics (and other custom metrics) and publish them to CloudWatch, where they can be visualized in dashboards. This is the standard AWS-recommended approach.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a custom CloudWatch metric namespace and publish memory data using the AWS CLI.
Why it's wrong here
While the AWS CLI's put-metric-data command can publish arbitrary custom metrics, it does not automatically collect memory data from EC2 instances. You would have to script the memory read on each instance, schedule it via cron, manage IAM credentials, and handle API failures—making it impractical compared to the CloudWatch agent, which is purpose-built for in-guest OS metric collection and publication.
- ✓
Install the Amazon CloudWatch agent on the EC2 instances to collect memory metrics and publish them to CloudWatch.
Why this is correct
The Amazon CloudWatch agent runs inside the guest OS and collects memory metrics such as mem_used_percent, mem_available, and mem_total, publishing them as custom metrics under the CWAgent namespace. It uses an IAM role for secure PutMetricData calls, can be configured via JSON, and can be centrally managed with AWS Systems Manager, making it the standard solution for OS-level metric collection.
- ✗
Enable detailed monitoring on the EC2 instances to collect memory metrics.
Why it's wrong here
Detailed monitoring only changes the interval of AWS-collected EC2 metrics from 5 minutes to 1 minute. These metrics are collected by the hypervisor and include CPU, network, and disk I/O, but never memory because the hypervisor has no visibility into guest OS memory usage. Memory metrics require a guest-side component like the CloudWatch agent.
- ✗
Use AWS CloudTrail to capture memory utilization events from the EC2 instances.
Why it's wrong here
AWS CloudTrail records API calls made to AWS services, such as EC2 RunInstances or StopInstances, for audit and governance purposes. It has no mechanism to capture guest OS performance counters like memory utilization, nor does it sample or stream any operating-system-level data; it is for operational auditing, not metric collection.
Go deeper
Related to this question
About these practice questions
One of 1,298 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
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.