CloudWatch
- Monitoring tool for your AWS resources and applications.
- Can create alarms that watch the metrics and send notifications or automatically make changes to the resources when a threshold is breached.
- Metrics have timestamps.
- No data aggregation between regions.
- Metrics for every service on AWS.
- Metric: A variable to monitor (CPUUtilization, NetworkIn, …). You can find a complete list of all metrics here
Glossary
| Name | Description | Side notes |
| Namespaces | A container for CloudWatch metrics. | Isolated from each other (To prevent aggregating different apps' statistics in one place) . |
| Metrics | A time-ordered set of data about the performance of your systems. |
|
| Dimensions | A key/value pair that uniquely identifies a metric. | Whenever you add a unique dimension to one of your metrics, you are creating a new variation of that metric. |
| Statistics | Aggregated data over specified periods of time. |
|
Some important metrics
| Service | Metrics |
|---|---|
| EC2 instances | CPU Utilization. Status Checks. Network. |
| EBS Volumes | Disk read/write. |
| S3 Buckets | BucketSizeBytes. NumberOfObjects. AllRequests. |
| API usage | CloudWatch Lambda. S3. |
But we can also create our own metrics.
CloudWatch alarms
- Goes off when a metric breaches a predefined threshold.
- Can be based on percentage/max/min or other units.
- Can configure how frequently check whether we breached the threshold or not.
- Can be in different states:
- OK.
- INSUFFICIENT_DATA.
- ALARM.
- Actions they can perform:
- Send a notification.
- Auto scaling.
- Perform EC2 actions: stop/terminate/reboot/recover.
- SNS notifications.
- You can easily create a new topic in SNS and subscribe to it with your email.
- Then in your CloudWatch you only need to create an alarm that publishes a message to that topic.
- Billing alarms can help us with budget management.
CloudWatch logs
- Collecting log files.
- Can collects from:
- ECS.
- Lambda.
- Route 53.
- CloudTrail.
- CloudWatch log agents installed on <table style="display:inline"><tr><td>EC2 instances1</td></tr><tr><td>on-premises servers</td></tr></table>.
- Elastic Beanstalk.
- You can monitor logs in real-time.
- Configurable in terms of retention; for how long should I keep them.

Footnotes
-
For this to work we need proper IAM role. ↩