Based on the SOA-C02 exam guideReport an error
The CloudWatch tools covered in Week 3 are independent of each other, but in actual operations, they form one observability pipeline. When an Alarm detects "something went wrong," the Dashboard shows "what range and how much," Agent lets you "look inside the guest OS," Synthetics maintains the "user perspective," and X-Ray traces "which service's which call" is the cause. When this pipeline works perfectly together, MTTD/MTTK (Mean Time To Know) from incident detection to root cause analysis shrinks.
Today we re-examine how these five tools actually connect structurally, organize each tool's internal design principles in comparison tables, and solve the 10 most frequent exam scenarios.
[Synthetics Canary] [Real Users + RUM]
24/7 availability LCP/CLS/JS errors
detection without traffic real user data only
│ │
▼ ▼
[CloudWatch Alarms] ←──── [CloudWatch Metrics] ←──── [CloudWatch Agent]
M of N evaluation (Standard + Custom) EC2 memory/disk
Composite Alarm Dashboard display procstat/StatsD
Anomaly Detection │ custom namespace
│ │
▼ ▼
[SNS/PagerDuty] [CloudWatch Dashboard]
[SSM Automation] Cross-Account OAM integration
[Auto Scaling] Golden Signals design
│
[X-Ray + ServiceLens]
distributed tracing → Logs jump
Service Map → Trace → Log
💡 Related Theory: This pipeline applies Observability, a concept from control theory, to modern distributed systems. First formalized by Rudolf Kalman in 1960 in "On the General Theory of Control Systems," it asks: "Can the internal state of a system be completely estimated from external outputs alone?" Metrics (numbers), Logs (text), and Traces (paths) are the "external outputs" in modern operations. CloudWatch integrates three signals into one platform, X-Ray handles Traces, and ServiceLens connects all three on one screen.
M of N vs Treat Missing Data
M of N controls "how long must the violation persist to trigger an alarm?" Treat Missing Data controls "how do we judge when data is absent?" These two settings are often confused.
| Setting | What It Controls | Key Use Case |
|---|---|---|
| M of N (EvaluationPeriods + DatapointsToAlarm) | Duration of violation | Ignore temporary spikes |
| Treat Missing Data: breaching | Missing data = violation | Services that must always be alive |
| Treat Missing Data: notBreaching | Missing data = healthy | Idle workloads, terminated instances |
| Treat Missing Data: missing (default) | Ignore gaps, evaluate other data | General cases |
| Treat Missing Data: ignore | Maintain current state | Maintenance windows |
Synthetics vs RUM vs X-Ray
| Item | Synthetics | RUM | X-Ray |
|---|---|---|---|
| Perspective | External bot | Real user browser | Service-to-service internal |
| Traffic Unnecessary | Y (synthetic) | N | N |
| Find Latency Cause | N | Partial (browser layer) | Y (Subsegment-level) |
| Service Map | N | N | Y |
| Cost Model | Per canary execution | RUM event count | Trace count |
| Detect No-traffic Downtime | Y | N | N |
💡 Related Theory: The distinction between these three tools corresponds to the difference between external quality and internal quality in software quality measurement theory. Synthetics and RUM measure external quality experienced by users, while X-Ray measures internal structural quality (which component adds which latency). Google SRE's "Golden Signals" (latency, traffic, errors, saturation) is a framework that combines both perspectives: Synthetics measures external latency and errors including availability, while X-Ray measures per-component internal latency and saturation.
Composite Alarm vs Metric Math Alarm
| Item | Composite Alarm | Metric Math Alarm |
|---|---|---|
| Input | State of other alarms (OK/ALARM) | Metrics + expressions |
| Expression | ALARM("a") AND ALARM("b") | e/r*100 > 5 |
| Purpose | Reduce alarm noise, service-level aggregation | Alarm on derived metrics like error rate |
| Actions Suppressor | Y (disable child alarm actions) | N |
| Cost | Composite Alarm + each child alarm charged | One alarm charged |
💡 Related Theory: The Boolean expression design of Composite Alarm has the same structure as logic circuit theory. Just as digital circuit design combines AND/OR/NOT gates to express complex conditions, alarms are combined as logical gates to judge "is the entire service degraded?" This abstraction layer aligns with Jens Rasmussen's (1983) "Skills, Rules, Knowledge" cognitive layering model: abstracting lower signals (child alarms) into higher semantic units (service state).
CloudWatch Agent Collected Metrics Types
| Metric | Collection Method | Namespace | Agent Required |
|---|---|---|---|
| CPU Utilization | Hypervisor | AWS/EC2 | No |
| Network In/Out | Hypervisor | AWS/EC2 | No |
| mem_used_percent | /proc/meminfo | CWAgent (custom) | Yes |
| disk_used_percent | statfs() syscall | CWAgent (custom) | Yes |
| Per-process CPU | /proc/[pid]/stat | CWAgent (custom) | Yes (procstat) |
| Application Custom | StatsD UDP 8125 | Custom specified | Yes (StatsD server) |
🔍 Deeper Dive: The way CloudWatch Agent reads
/proc/meminfoon Linux differs fundamentally from reading WMI (Windows Management Instrumentation) Performance Counters on Windows. On Linux, procfs is a virtual filesystem through which the kernel exposes memory statistics in real-time. Themem_used_percentis calculated by combiningMemTotal,MemFree,Buffers, andCachedfields. The formula is(MemTotal - MemFree - Buffers - Cached) / MemTotal × 100, matching theusedcolumn of thefree -mcommand. On Windows, the\Memory\% Committed Bytes In Usecounter is used.
X-Ray Sampling: Reservoir + Fixed Rate Flow
2000 requests per second → Sampling Rule applied
│
Reservoir = 10 (at least 10 per second guaranteed)
│
┌─────────┴─────────┐
First 10 requests Remaining 1990
(100% sampling) Fixed Rate = 5% applied
= approximately 99 additional samples
│
Approximately 109 traces sent per second
💡 Related Theory: X-Ray's Reservoir + Fixed Rate design is structurally identical to the Token Bucket algorithm in network traffic control. Reservoir is the bucket size (burst capacity), and Fixed Rate is the sustained processing rate. RFC 2697 (srTCM, Single Rate Three Color Marker) and RFC 2698 (trTCM) standardize this pattern. During low-traffic periods (early morning), the Reservoir alone is sufficient for sampling, while during high-traffic periods (lunch time), Fixed Rate controls costs with automatic adjustment.
Anti-patterns of each tool learned in Week 3 compiled at once.
Alarm Anti-Patterns
Dashboard Anti-Patterns
Agent Anti-Patterns
X-Ray Anti-Patterns
📚 Case Study: In 2023, a major e-commerce company A (public case) left X-Ray 100% sampling on during Black Friday prep and received an unexpected $8,000 X-Ray bill for one day. After switching to fixed Reservoir + low Fixed Rate (1%) during traffic surge periods, cost dropped to $40/day while maintaining 100% error tracing via separate Priority 1 Rule. Sampling Rule design is a high-ROI optimization point.
⚠️ Pitfall: ServiceLens is a view integrating CloudWatch, X-Ray, and Synthetics Canary data, but all three services must be operating normally. If Lambda Active Tracing is disabled, Lambda won't appear in ServiceLens Service Map. If X-Ray SDK doesn't wrap AWS SDK, downstream services like DynamoDB and SQS disappear from the Map. If ServiceLens screen looks empty, first check X-Ray SDK configuration and Active Tracing status.
| Feature | AWS CloudWatch | GCP Cloud Operations | Azure Monitor |
|---|---|---|---|
| Metrics | CloudWatch Metrics | Cloud Monitoring | Azure Monitor Metrics |
| Logs | CloudWatch Logs | Cloud Logging | Log Analytics |
| Traces | X-Ray | Cloud Trace | Application Insights |
| Agent | CloudWatch Agent | Ops Agent | Azure Monitor Agent |
| Synthetic Monitoring | Synthetics Canary | Uptime Checks | Application Insights Availability |
| Anomaly Detection | Anomaly Detection | Alerting Policy ML | Dynamic Threshold |
| Cross-Account | OAM Sink+Link | Workspace-based | Resource scope |
| Dashboard | CloudWatch Dashboard | Cloud Monitoring Dashboard | Azure Dashboard |
🔍 Deeper Dive: GCP's Ops Agent is structurally similar to CloudWatch Agent but uses OpenTelemetry Collector as its internal pipeline. CloudWatch Agent operates as its own Go binary. Azure Monitor Agent differs by defining collection policies centrally via DCR (Data Collection Rules). CloudWatch Agent corresponds by centralizing configuration via SSM Parameter Store. All three platforms clearly distinguish between metrics collectible without an agent (hypervisor layer) and metrics requiring an agent (OS layer).
When actual incidents occur, the order in which to use CloudWatch tools is organized by scenario.
Scenario: API Response Time Spike
1. Composite Alarm triggers (ALB Latency High AND EC2 CPU High)
→ PagerDuty alert
2. View overall scope in CloudWatch Dashboard
- ALB RequestCount, TargetResponseTime
- EC2 CPUUtilization (Agent custom: mem_used_percent, disk_used_percent)
3. Check Service Map in X-Ray ServiceLens
- Which service (Lambda, DynamoDB, RDS) has latency?
4. Error service Trace details → identify bottleneck at Subsegment level
5. ServiceLens "View Logs" → immediately see relevant execution logs in CloudWatch Logs
6. Synthetics Canary results → check user endpoint availability status
💡 Related Theory: This response order is a "Breadth-First Search → Depth-First" strategy. Start wide (dashboard, entire service map), then narrow scope (specific service Trace) and dig deep (Subsegment, logs). This is the core of "structured troubleshooting" recommended by Google SRE: from symptom to cause, from broad hypotheses to narrow ones.
Click a choice to reveal the answer and explanation.
Question 1
An EC2 instance was forcibly terminated by OOM. The memory alarm has Treat Missing Data = missing and EvaluationPeriods=5. Currently 2 data points are missing. What is the alarm state?
Question 2
In one incident, the operations team had 20 alarms for EC2/RDS/ALB/ElastiCache fire at the same time, so PagerDuty paged 20 times. What is the most structural way to solve this?
Question 3
You created an alarm for 90% EC2 memory utilization, but you cannot find that metric in CloudWatch. What is the cause and the fix?
Question 4
A company operates 5 AWS accounts. It wants to see EC2 CPU for all accounts on a single dashboard. What is the correct configuration?
Question 5
The API went down at 2 AM, but because there was no traffic, RUM had no data and no alarm fired. What is the most appropriate tool to prevent this problem?
Question 6
You newly enabled an Anomaly Detection alarm, but it has not fired even once in 2 weeks. Is this normal or a problem?
Question 7
You want to trace the latency of a DynamoDB query inside a Lambda function with X-Ray. What are the two required actions?
Question 8
You deployed the CloudWatch Agent to 100 EC2 instances, but on some instances the Agent configuration was reset (overwritten with a different configuration). How do you prevent this?
Question 9
What is the biggest practical benefit of using ServiceLens?
Question 10
X-Ray cost has spiked. An API with traffic of 2000 RPS currently uses the default sampling (Reservoir=1, Fixed Rate=5%). How can you reduce cost while ensuring that requests are always traced when errors occur?
Week 4 is the week of audit tools that track "who did what" and "does the current state comply with regulations?"
If CloudWatch showed "what's happening right now," CloudTrail + Config tracks "what happened, who did it, and whether we're compliant." Both domains carry high exam weight in SOA-C02.