Swiftorial Logo
Home
Swift Lessons
AI Tools
Learn More
Career
Resources

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:

  1. Enable CloudWatch in the AWS console or CLI.
  2. Create dashboards and alarms.
  3. 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.