Management and Governance
Amazon CloudWatch
Service for monitoring AWS resources and applications in real time. It collects metrics and logs, displays dashboards, and triggers alarms that notify you or take actions when a threshold is breached.
Exam phrases that point here
«monitor performance metrics and get an alert when a threshold is exceeded»
CloudWatch collects metrics from AWS resources and applications, and its alarms compare each metric against a threshold to send a notification (for example, with Amazon SNS) or take action.
When not: If the question is who made an API call or which user changed something, the clue points to AWS CloudTrail; if it is whether a resource's configuration complies with a policy, to AWS Config.
«collect memory and disk metrics from EC2 instances»
The metrics that EC2 sends by default are measured from outside the instance. For guest operating system metrics, such as memory or disk usage, you install the CloudWatch agent, which also works for on-premises servers.
When not: If what is asked for is the API calls on those instances, it is CloudTrail. And if the team wants container metrics in Prometheus format queried with Prometheus tools, Amazon Managed Service for Prometheus may be a better fit.
«centralize application logs and query them interactively»
CloudWatch Logs receives logs from the agent and from many AWS services, and CloudWatch Logs Insights lets you query them without any prior preparation.
When not: If the record of interest is the account's API call history for auditing, it is CloudTrail. If the question asks for full-text search and large-scale log analytics dashboards, Amazon OpenSearch Service may also appear.
«automatically stop, reboot, or recover an EC2 instance when a check fails»
An alarm on an EC2 metric can directly run an action on the instance: stop it, terminate it, reboot it, or recover it.
When not: If the goal is to replace unhealthy instances within a fleet, this is usually done by an Amazon EC2 Auto Scaling group with its health checks, not an alarm per instance.
«count the number of times an error appears in the logs and alert when it keeps happening»
A metric filter turns the log lines that match a pattern into a CloudWatch metric, and an alarm is created on that metric.
When not: The metric filter only counts events after its creation. If the error to detect is a specific API call (for example, deleting a trail), you can react to the CloudTrail event with Amazon EventBridge.
Often paired with
- Amazon SNS
- Amazon EC2 Auto Scaling