DOP-C02 Monitoring and Logging Practice Question
A company runs a critical application on Amazon ECS with Fargate. The DevOps team wants to set up a metric to track the number of tasks running. Which TWO steps are required to achieve this? (Choose TWO.)
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
✓
Create a CloudWatch alarm on the 'RunningTaskCount' metric.
Options A and C are correct. Container Insights must be enabled for the ECS cluster (C) to generate the 'RunningTaskCount' metric. Then a CloudWatch alarm can be created on that metric (A) to track the number of tasks. Option B is incorrect because the CloudWatch agent is not needed for Fargate; metrics are provided via Container Insights. Option D is incorrect because CloudWatch Logs subscription filters are used for filtering log events, not for generating metrics. Option E is incorrect because a service auto scaling target is used for scaling, not for monitoring task count.
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 CloudWatch alarm on the 'RunningTaskCount' metric.
Why this is correct
The RunningTaskCount metric is an ECS control-plane metric automatically emitted by AWS for each service and cluster, including services running on Fargate. An alarm on this metric can directly compare the current running task count against a threshold or the DesiredTaskCount, and notify via SNS when it falls below expected levels. This is the simplest, most direct way to detect service degradation without any additional agents or instrumentation.
- ✗
Install the CloudWatch agent on the task containers.
Why it's wrong here
The CloudWatch agent is a software daemon intended for EC2 instances and on-premises servers to collect operating system-level metrics and custom logs. In the Fargate launch type, you do not have access to the underlying infrastructure, and AWS does not support installing the agent directly into task containers; doing so would require a custom sidecar and would not expose the ECS service-level RunningTaskCount metric. ECS automatically publishes task count metrics to CloudWatch, so the agent adds no value for this monitoring requirement.
- ✓
Enable Container Insights for the ECS cluster.
Why this is correct
Container Insights for ECS is an AWS-integrated monitoring solution that automatically gathers telemetry from clusters, services, and tasks, including metrics such as RunningTaskCount, CPU, and memory. To activate it you only need to enable Container Insights on the cluster; it then uses the embedded CloudWatch agent and performance events to aggregate data into the ECS/ContainerInsights namespace. This provides a richer operational view and can also be the foundation for alarms through the service's built-in dashboards.
- ✗
Configure a CloudWatch Logs subscription filter to count tasks.
Why it's wrong here
A CloudWatch Logs subscription filter is designed to stream matched log entries to a target like Lambda or OpenSearch for real-time processing, not to generate time-series metrics. To count tasks, you would need to ensure every task produces a recognizable log entry on startup, then build a separate consumer to count those events and publish a custom metric—an indirect, complex, and error-prone approximation. Moreover, log events are not emitted for tasks that fail before logging, so subscription filters cannot reliably reflect the actual RunningTaskCount metric.
- ✗
Create a service auto scaling target for the ECS service.
Why it's wrong here
A service auto scaling target is an Application Auto Scaling configuration that defines the resource type and minimum/maximum capacity for a service; it simply declares that scaling is enabled. By itself, it does not monitor anything, emit metrics, or raise alarms—you would still need a scaling policy (e.g., target tracking on CPU or memory) to actually adjust capacity. Creating a scaling target never changes the CloudWatch metric availability; it is purely a mechanism for managing desired count, not for detecting or alerting on running task shortages.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,339-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.