Stop 14 · Monitoring, Security & Cost OptimizationTopics · 1/10

Amazon CloudWatch Metrics & Alarms

Part of the AWS Roadmap

In short

The moment you launch a server, your cloud is already recording numbers about it. Learning to read those built-in metrics is the cheapest monitoring you'll ever set up.

CloudWatch collects metrics from AWS services and your apps, displays them on dashboards and triggers alarms when values cross thresholds. Alarms can notify through SNS or trigger actions such as Auto Scaling. Memory and disk metrics for EC2 need the CloudWatch agent.

The blob character drives a car and glances at the dashboard gauges.

Think of it like this

The car's dashboard

Every car comes with a speedometer, fuel gauge and engine light. You didn't install them, and they don't tell you everything, but they warn you before the engine seizes. Built-in cloud monitoring is that dashboard.

Watch it happen

What CloudWatch sees, and what it can't

EC2 instance
CW agent
CloudWatch
You

CPUUtilization

1/5From outside the VM, AWS sends CPU, network and disk metrics automatically. No setup needed.

The big ideas

What you need to know

Three names, one idea

AWS CloudWatch, Google Cloud Monitoring and Logging (once called Stackdriver), and Azure Monitor.

Free basics

Managed services publish key metrics automatically: Lambda errors, RDS connections, ALB 5xx counts.

Agents for the inside

OS-level numbers and app logs need an agent or an SDK sending them.

When to add more

Many teams later add Grafana, Datadog or Prometheus. Built-in tools are still the place to start.

See it in code

Walk through the code

bash
1aws cloudwatch get-metric-statistics \2  --namespace AWS/EC2 --metric-name CPUUtilization \3  --dimensions Name=InstanceId,Value=i-0abc123 \4  --start-time 2026-10-27T00:00:00Z --end-time 2026-10-27T06:00:00Z \5  --period 300 --statistics Average Maximum

1/3Which metric, for which instance. Dimensions narrow down the series.

Basic EC2 monitoring reports every 5 minutes. Detailed monitoring gives 1-minute data for an extra charge.

Save yourself the pain

Common mistakes

Oops

Assuming low CPU means the server is fine, when it's actually out of memory.

Do this instead

Install the agent so you can see memory and disk space, not just CPU.

Oops

Keeping every log group forever by default.

Do this instead

Set a retention period on each log group. Unlimited retention quietly grows your bill.

Your mission

Read your server's vital signs

~30 min

Quick check

Why doesn't EC2 show memory usage in CloudWatch by default?

Go deeper

  1. 1Create a dashboard with CPU, network and request count for one of your projects.
  2. 2Set an alarm on high CPU that sends an email through SNS.
  3. 3Install the CloudWatch agent on an EC2 instance to collect memory usage.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge