CloudWatch Essentials:
- CloudWatch is used to monitor AWS services, such as EC2, ELB and S3.
- You monitor your environment by configuring and viewing CloudWatch metrics.
- Metrics are specific to each AWS service or resource, and include such metrics as:
- EC2 per-instance metrics:
- CPUUtilization
- CPUCreditUsage
- S3 metrics:
- NumberOfObjects
- BucketSizeBytes
- ELB metrics:
- RequestCount
- UnhealthyHostCount
- EC2 per-instance metrics:
- Detailed vs. Basic level monitoring
- Basic: Data is available automatically in 5-minute periods at no charge.
- Detailed: Data is available in 1-minute periods.
- CloudWatch Alarms can be created to trigger alerts (or other actions in your AWS accounts, such as an SNS topic), based on threshold you set on CloudWatch metrics.
- Auto Scaling heavily utilizes CloudWatch - relying on threshold and alarms to trigger the addition (or removal) of instances from an auto scaling group.
CloudWatch Alarms:
- CloudWatch Alarms allow for you (or the system admin) to be notified when certain defined threshold are met on CloudWatch metrics.
- For example, you can setup an alarm to be triggered whenever the CPUUtilization metric on an EC2 instance goes above 70%.
- Alarm can also be used to trigger other events in AWS like publishing to an SNS topic or triggering auto scaling.
CloudWatch EC2 Monitoring:
System Status Checks: (things that our outside of our control)
- Loss of network connectivity.
- Loss of system power.
- Software issues on the physical host.
- Hardware issues on the physical host.
- How to solve: Generally stopping and restarting the instance will fix the issue. This causing the instance to launch on a different physical hardware device.
Instance Status Checks: (software issues that we do control)
- Failed system status checks.
- Misconfigured networking or startup configuration.
- Exhausted memory.
- Corrupted file system.
- Incompatible kernel.
- How to solve: Generally a reboot, or solving the file system configuration issue.
By default, CloudWatch will automatically monitor metrics that can be viewed at the host level (NOT the software level), such as:
CPUUtilization
Network in/out
CPUCreditBalance
CPUCreditUsage
OS level metrics that required a third party script (perl) to be installed (provided by AWS)
Memory utilization, memory used, and memory available.
Disk swap utilization
Disk space utilization, disk space used, disk space, available.