AWS Builder Center
Monitoring AWS Resources with Amazon CloudWatch

Monitoring AWS Resources with Amazon CloudWatch

Hands-on notes on CloudWatch metrics, dimensions, dashboards, alarms, agents, and automated actions.

Cloud Engineer | AWS | Generative AI & Agentic AI
I recently completed the AWS SimuLearn: Resource Monitoring lab and learned how Amazon CloudWatch can monitor AWS resources, visualize metrics, detect problems, and trigger automated actions.
The main workflow I learned was:
1
2
3
4
5
6
7
8
9
10
11
AWS Resource
↓
Metrics
↓
CloudWatch
↓
Dashboard
↓
Alarm
↓
Notification / Automated Action

Metrics, Namespaces, and Dimensions

A metric is a value measured over time, such as CPU usage, network traffic, or memory usage.
CloudWatch organizes metrics into namespaces:
1
2
3
AWS/EC2
AWS/Lambda
PowerPlantMetrics
A dimension identifies what a metric belongs to.
1
2
3
4
5
Metric: CPU_USAGE_IDLE

Dimensions:
InstanceId = i-123
InstanceType = t3.micro
My mental model is:
1
2
Metric = What am I measuring?
Dimension = Which resource does it belong to?

EC2 Monitoring

Amazon EC2 automatically publishes several infrastructure metrics to CloudWatch.
1
2
3
4
5
6
Basic Monitoring
→ 5-minute metric periods

Detailed Monitoring
→ 1-minute metric periods
→ faster visibility and alarms
For operating-system-level metrics such as memory usage, the CloudWatch Agent can collect data from inside the EC2 instance.
1
2
3
4
5
6
7
EC2 OS
↓
CloudWatch Agent
↓
Custom Metrics
↓
CloudWatch

Publishing Custom Metrics

An application or CloudWatch Agent can also publish custom metrics through the CloudWatch API.
For an EC2 instance to push metrics, I learned that it generally needs:
1
2
3
4
5
CloudWatch Agent / Application
+
IAM permission
+
Network path to CloudWatch
For example, the IAM role may allow:
1
cloudwatch:PutMetricData
Using an IAM role is better than storing long-term access keys directly on the EC2 instance.

Dashboards

CloudWatch Dashboards combine multiple graphs and monitoring widgets into one place.
1
2
3
4
5
6
Power Plant Dashboard
├── CPU Server 1
├── CPU Server 2
├── CPU Server 3
├── Memory Usage
└── Alarm Status
A widget can also keep its own time range, such as Last 3 hours, instead of following the dashboard's global time range.

Alarms and Automated Actions

A CloudWatch Alarm evaluates a metric against a condition.
For example:
1
2
3
4
5
mem_used > 300 MB
↓
CloudWatch Alarm
↓
ALARM
The alarm can then trigger an action:
1
2
3
4
5
6
7
8
CloudWatch Alarm
↓
┌─────┴─────┐
↓ ↓
SNS EC2 Action
↓ ↓
Notify Reboot
Engineer Instance
This means engineers do not need to watch the dashboard continuously. CloudWatch can detect the problem and respond automatically.

My Main Takeaway

The simplest mental model I took away from this lab is:
1
2
3
4
5
Metrics = What is happening?
Dimensions = Which resource?
Dashboard = Show everything together
Alarm = Detect a problem
Action = What should happen next?
CloudWatch is more than a graphing tool. It provides a centralized way to collect, visualize, detect, alert, and respond to changes in AWS resources and applications.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article