AWS CloudWatch and EC2 Monitoring
Key Points
- CloudWatch Integration with EC2: AWS CloudWatch provides monitoring for EC2 instances, automatically pushing metrics.
- Basic vs. Detailed Monitoring:
- Basic Monitoring: Metrics are collected every five minutes.
- Detailed Monitoring: Metrics are collected every one minute (additional costs apply).
Important Metrics for EC2
- CPU Metrics:
- CPU Utilization
- CPU Credit Usage and Balance (for T2/T3 burstable instances)
- Network Metrics:
- Network In/Out
- Packet Count
- Disk Metrics (Instance Store-backed instances only):
- Disk Read/Writes Operations
- Disk Read/Write Bytes
- Status Check Metrics:
- Instance Status (EC2 VM health)
- System Status (Underlying hardware health)
Custom Metrics
- Resolution: Basic (1 minute) and High Resolution (up to 1 second)
- Examples: RAM usage, Application-level metrics
- IAM Role: EC2 instances must have an IAM role with permissions to push metrics to CloudWatch.
- It Can be used without enabling detailed monitoring.
Important Notes
- RAM Usage: Not included in AWS-provided EC2 metrics; must be pushed as a custom metric.
- EBS Volumes: Disk Read/Writes metrics for EBS-backed instances are found on the EBS volume, not the EC2 instance.
CloudWatch Dashboard
- Creating a Dashboard: Allows for easy monitoring of various metrics.
- Adding Metrics: Users can select and add metrics to the dashboard for visualization.