AWS FAQ: CloudWatch
10. What is Amazon CloudWatch and what can it monitor?
Amazon CloudWatch is a monitoring and observability service for AWS resources and applications. It collects metrics, logs, and events for insight and alerting.
πΊοΈ Step-by-Step Instructions:
- Enable CloudWatch in the AWS console or CLI.
- Create dashboards and alarms.
- Set thresholds and automate responses.
π₯ Example Input:
Metric: CPUUtilization
Threshold: 80%
π Expected Output:
Alert triggered when EC2 CPU exceeds 80%.
β CLI Alarm Example:
aws cloudwatch put-metric-alarm --alarm-name HighCPU --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 300 --threshold 80 --comparison-operator GreaterThanThreshold --evaluation-periods 2 --alarm-actions arn:aws:sns:...
π Detailed Explanation:
- Logs: Collect logs from applications, Lambda, and ECS.
- Alarms: Trigger actions like Lambda functions or SNS alerts.
- Dashboards: Visualize data with custom panels.
π οΈ Use Cases:
- Monitoring system health and resource usage.
- Setting alerts for threshold violations.
- Logging and debugging cloud applications.
