SOA-C02 Practice Question: CloudWatch agent configuration for collecting…
The monitoring team needs to collect per-process CPU and memory utilization for a specific Java process (named 'app.jar') running on EC2 Linux instances. Standard EC2 metrics show aggregate CPU but not per-process details. Which CloudWatch agent configuration section enables this?
⚠ Common exam trap
A common mix-up: candidates confuse 'enhanced monitoring' (a hypervisor-level feature) with OS-level per-process monitoring, or incorrectly assume that CloudWatch Logs metric filters can derive CPU/memory metrics from application logs, when in fact only the CloudWatch agent's `procstat` plugin can collect actual OS-level per-process resource utilization.
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
✓
Add a procstat section under metrics_collected in the CloudWatch agent config, specifying process_name = 'app.jar' to collect per-process CPU and memory
The CloudWatch agent's `procstat` plugin is specifically designed to collect per-process metrics such as CPU and memory utilization. By adding a `procstat` section under `metrics_collected` in the agent configuration file and specifying the process name (e.g., `process_name = 'app.jar'`), the agent will gather the required per-process metrics and send them to CloudWatch. This is the only native method within the CloudWatch ecosystem to achieve per-process monitoring on EC2 Linux instances.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Add a procstat section under metrics_collected in the CloudWatch agent config, specifying process_name = 'app.jar' to collect per-process CPU and memory
Why this is correct
The procstat plugin uses the Linux /proc filesystem to sample per-process resource usage. With process_name set to 'app.jar', the agent matches the running JVM process and publishes metrics like procstat_cpu_usage and procstat_memory_rss to CloudWatch every collection interval. These metrics carry instance ID and process name dimensions.
- ✗
Enable enhanced monitoring on the EC2 instance and select 'per-process metrics' from the console
Why it's wrong here
There is no per-process metrics option in the EC2 enhanced monitoring console. Enhanced monitoring for EC2 refers to the 1-minute detailed monitoring frequency, which affects only the standard EC2 metrics. Per-process collection requires the CloudWatch agent's procstat plugin.
- ✗
Configure a CloudWatch Logs metric filter on the Java GC log output to derive CPU and memory figures
Why it's wrong here
GC logs record garbage collection events, heap sizes before/after GC, and pause times. They do not contain CPU percent or RSS memory values directly. A metric filter can only count pattern occurrences or extract numeric values from log lines — it cannot generate accurate process-level CPU or memory utilization metrics.
- ✗
Use the aws ec2 describe-instance-status API on a schedule to pull process metrics from the instance's system status checks
Why it's wrong here
The aws ec2 describe-instance-status API returns only the two EC2 status checks: system status (e.g., lost network connectivity, power loss) and instance status (e.g., failed system tests, misconfigured networking). These checks are processed by the hypervisor and the EC2 service, respectively, and report pass/fail or impaired states. They never reach into the guest OS to inspect running processes like 'app.jar', nor do they sample /proc to compute per-process CPU or memory metrics. Additionally, this API is a polling-based status query, not a metrics stream, so it cannot produce the continuous procstat-style data that the CloudWatch agent would collect.
Go deeper
Related to this question
About these practice questions
This SOA-C02 question is part of Courseiva's 247-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 SOA-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 SOA-C02 exam.