Introduction to Amazon CloudWatch
Metrics, logs and alarms for monitoring AWS resources and applications.
- 8 lessons
- Module quiz
Once an application is running, its team needs to know whether it is healthy, to be told quickly when it is not, and to have the evidence to find out why. That evidence takes the form of metrics, which are numbers measured over time such as error counts and latency, and logs, which record individual events in detail.
Amazon CloudWatch is AWS's monitoring and observability service. AWS services publish metrics to it automatically, applications add their own custom metrics, and logs from services and applications are collected in CloudWatch Logs. Alarms watch metrics and notify people or take actions when thresholds are crossed, and dashboards display the results. AWS services publish most standard metrics every minute, or every five minutes for EC2 basic monitoring, and high-resolution custom metrics go down to one second. CloudWatch is charged per custom metric, alarm and dashboard, and per gigabyte of logs ingested and stored.
Where CloudWatch fits
CloudWatch is central to Domain 4 of the exam, Troubleshooting and Optimization. Questions cover publishing custom metrics, turning log patterns into metrics, querying logs, setting alarms and log retention, and using structured logging so that logs can be queried and turned into metrics automatically. Tracing individual requests is covered in the AWS X-Ray module.
How this module is organised
Monitoring Applications with CloudWatch Metrics and Alarms explains metrics, custom metrics and alarms, and Storing and Querying Application Logs with CloudWatch Logs explains how logs are stored and searched. Distinguishing Logging, Monitoring and Observability distinguishes these three ideas, and Writing Structured Logs with Powertools for AWS Lambda explains how to write logs that are easy to query. Visualising Application Health with Dashboards and CloudWatch Insights covers visualisation and analysis, and Alerting on Problems with Alarms, Events and Notifications explains how alerts reach the right people. Finding Slow Code and Right-Sizing Lambda Memory explains how to find performance problems and size resources, and Classifying Sensitive Data and Masking It in Logs and Messages explains how sensitive data in logs is protected.
- Monitoring Applications with CloudWatch Metrics and Alarms Lesson 1
- Storing and Querying Application Logs with CloudWatch Logs Lesson 2
- Distinguishing Logging, Monitoring and Observability Lesson 3
- Writing Structured Logs with Powertools for AWS Lambda Lesson 4
- Visualising Application Health with Dashboards and CloudWatch Insights Lesson 5
- Alerting on Problems with Alarms, Events and Notifications Lesson 6
- Finding Slow Code and Right-Sizing Lambda Memory Lesson 7
- Classifying Sensitive Data and Masking It in Logs and Messages Lesson 8
- Practise and review
- Test your knowledge 10 questions