Amazon CloudWatch
Metrics & alarms
Collects metrics and logs, builds dashboards and creates alarms; alarms can send notifications or trigger actions (scaling).
- Cost$$ Medium
- Difficulty●●●●●
- Costs money when idle?Yes
- Managed by AWS
- In examsCLF · SAA · DVA · SOA
Think of it asLike a car's dashboard with warning lights.
Where does CloudWatch fit?
Calls CloudWatch
CloudWatch calls
A real example, step by step
- Your app sometimes slows down badly and nobody notices until customers complain.
- CloudWatch already collects EC2 CPU, network and ALB latency; you install the CloudWatch agent to get memory and disk metrics too.
- You set an alarm: CPU above 80% for 5 minutes sends a message to an SNS topic, and the on-call team gets an SMS.
- Another alarm triggers Auto Scaling to add instances under heavy load.
- You build a dashboard so the whole team can watch the system's health in real time.
When to use it
✓ Use it when
Always: monitoring the health of every service.
✗ Avoid it when
You need to know WHO called which API → CloudTrail.
Common uses
- Monitor CPU, latency, errors of every service
- Alarms that page on-call staff via SNS
- Trigger Auto Scaling
- Operations dashboards
CloudWatch, CloudTrail or CloudWatch Logs?
| Answers | How is the system running? | Who did what, and when? | What did the app write out? |
|---|---|---|---|
| Data | Metrics, alarms, dashboards | History of API calls | Log lines |
| Used for | Monitoring, alerting, auto scaling | Auditing, security investigations | Debugging, searching logs |
| By default | Basic 5-minute metrics, free | 90 days of management history, free | Kept forever unless you set retention |
What does it cost?
- Pricing model: Basic metrics are free; custom metrics ~$0.30/metric/month; alarms ~$0.10/month; dashboards ~$3/month; API calls to fetch data billed by volume.
- Free tier: Always Free: 10 custom metrics, 10 alarms, 3 dashboards, 1 million API requests per month.
Custom metrics with many dimensions (each combination counts as a metric); enabling 1-minute detailed monitoring on every EC2; third-party tools calling GetMetricData constantly.
EC2 memory and free disk space aren't available by default → install the CloudWatch agent. Need one-minute metrics → enable detailed monitoring. SMS/email when a threshold is crossed → an alarm that publishes to SNS. “Who deleted a resource” is CloudTrail's job, not CloudWatch's.
Try real exam questions
1What is the time period with which metric data is sent to CloudWatch when detailed monitoring is enabled on an Amazon EC2 instance?
- A15 minutes.
- B5 minutes.
- C1 minute.
- D45 seconds.
Show answer
Correct answer: C
With detailed monitoring, EC2 sends metrics to CloudWatch every 1 minute; the default (basic monitoring) is every 5 minutes.
2A user is running a webserver on EC2. The user wants to receive the SMS when the EC2 instance utilization is above the threshold limit. Which AWS services should the user configure in this case?
- AAWS CloudWatch + AWS SQS.
- BAWS CloudWatch + AWS SNS.
- CAWS CloudWatch + AWS SES.
- DAWS EC2 + AWS Cloudwatch.
Show answer
Correct answer: B
A CloudWatch alarm watches the EC2 CPU and publishes to an SNS topic with an SMS subscription. SQS is a queue and can't send SMS; SES is an email service.
Frequently asked questions
Why doesn't CloudWatch show EC2 memory usage?
By default CloudWatch only sees what can be measured from outside the instance, such as CPU, network and disk I/O. Memory and free disk space live inside the operating system, so you must install the CloudWatch agent to send them as custom metrics.
How is CloudWatch priced?
Basic metrics from AWS services are free. You pay for custom metrics, detailed one-minute metrics, alarms, dashboards, API calls, and logs (by data ingested and stored).
What do AWS exams ask about CloudWatch?
Alarms that trigger Auto Scaling or send notifications through SNS, custom metrics via the agent, one-minute detailed monitoring, alarms that recover EC2 instances, and telling it apart from CloudTrail and AWS Config.