CloudWatch Metrics for EC2
Understand AWS-provided and custom CloudWatch metrics for EC2 instances, including monitoring intervals and key performance indicators.
What You'll Learn
Monitoring Your EC2 Instances
Amazon CloudWatch is AWS's monitoring and observability service that collects metrics from your EC2 instances. Understanding what metrics are available, how often they're collected, and what's NOT automatically monitored is crucial for effective CloudOps. This knowledge helps you set up proper monitoring, alerting, and capacity planning for your infrastructure.
Key Point
CloudWatch provides both AWS-managed metrics (pushed automatically) and the ability to publish custom metrics.
Key Terms
A time-ordered set of data points representing a measurable attribute of a resource
The default free monitoring tier with metrics collected at 5-minute intervals
Paid monitoring option with metrics collected at 1-minute intervals for more granular visibility
Basic vs Detailed Monitoring
| Feature | Basic Monitoring | Detailed Monitoring | |
|---|---|---|---|
| Collection Interval | 5 minutes | 1 minute | |
| Cost | Free (default) | Additional charges apply | |
| Data Granularity | Less responsive to spikes | Better for detecting rapid changes | |
| Use Case | Development, non-critical workloads | Production, Auto Scaling triggers |
Detailed monitoring is recommended for production workloads and when using Auto Scaling
AWS-Provided EC2 Metrics
AWS automatically pushes certain metrics to CloudWatch for every EC2 instance. These metrics cover CPU utilization, network traffic, disk operations (for instance store only), and status checks. Understanding what's included helps you know when you need custom metrics.
Key Point
AWS provides metrics for CPU, Network, Disk (instance store), and Status Checks—but NOT RAM.
EC2 Metrics Categories
Categories of metrics available for EC2 instances
EC2 Metrics
AWS-provided metrics
CPU
Utilization, Credits
Network
In/Out bytes and packets
Disk
Instance store only
Status Checks
Instance, System, EBS
CPU Metrics
- CPUUtilization: Percentage of allocated compute units in use
- CPUCreditUsage: Number of CPU credits consumed (burstable instances)
- CPUCreditBalance: Number of CPU credits accumulated (burstable instances)
Network Metrics
- NetworkIn: Bytes received on all network interfaces
- NetworkOut: Bytes sent out on all network interfaces
- NetworkPacketsIn: Number of packets received
- NetworkPacketsOut: Number of packets sent
Status Check Metrics
- StatusCheckFailed_Instance: Checks the EC2 VM health (1 = failed, 0 = passed)
- StatusCheckFailed_System: Checks the underlying hardware (1 = failed, 0 = passed)
- StatusCheckFailed_AttachedEBS: Checks attached EBS volume health
- StatusCheckFailed: Combined check (fails if any check fails)
RAM is NOT Included!
Memory (RAM) utilization is NOT included in AWS-provided EC2 metrics. To monitor RAM, you must install the CloudWatch Agent and publish custom metrics. This is one of the most common exam questions!
Disk Metrics Limitation
The Disk Read/Write metrics (DiskReadOps, DiskWriteOps, DiskReadBytes, DiskWriteBytes) are only available for instances using instance store volumes. EBS volumes have their own separate metrics in CloudWatch.
Custom Metrics
For metrics that AWS doesn't provide automatically—like RAM usage, disk space, or application-specific data—you need to publish custom metrics. Custom metrics can be published at different resolutions: Standard Resolution (1-minute granularity) or High Resolution (down to 1-second granularity). Publishing custom metrics requires proper IAM permissions on the EC2 instance role.
Key Point
Custom metrics require the CloudWatch Agent and proper IAM permissions to publish.
Custom Metric Resolutions
| Resolution | Interval | Use Case | |
|---|---|---|---|
| Standard | 1 minute | 1 minute | Most monitoring needs |
| High Resolution | 1 second | Up to 1 second | Real-time monitoring, rapid scaling |
High resolution metrics incur higher costs due to increased data volume
Common Custom Metrics
- Memory (RAM) utilization and available memory
- Disk space usage (percentage and absolute)
- Application-level metrics (request counts, error rates)
- Process-specific metrics (individual process CPU/memory)
- Custom business metrics (transactions per second, active users)
IAM Permissions Required
To publish custom metrics, the EC2 instance role must have the cloudwatch:PutMetricData permission. Without this, the CloudWatch Agent cannot send metrics to CloudWatch.
Pause & Ponder
Why do you think AWS doesn't include RAM metrics by default?
- •Consider the hypervisor's visibility into the guest OS
- •Think about what the hypervisor can see vs. what runs inside the instance
- •How does this differ from CPU utilization measurement?
Ready to Start Learning?
Dive deeper into this lesson with our interactive learning experience. Complete the quiz and earn 60 XP!
Start This LessonContinue Your Journey
EC2 Instance Type Management
Learn how to change EC2 instance types and understand the requirements for resiz...
Lesson 2EC2 Placement Groups
Master EC2 placement group strategies to optimize instance placement for perform...
Lesson 3EC2 SSH Connectivity & Troubleshooting
Master SSH connections to EC2 instances, including traditional SSH, EC2 Instance...