Amazon CloudWatch basics
Topic: Cloud aws core
Summary
CloudWatch provides metrics, logs, and alarms in AWS. EC2 and many services send metrics automatically. Use for monitoring and alerting on AWS resources.
Intent: How-to
Quick answer
- Metrics are in CloudWatch Metrics. Namespace and metric name. Dimensions for instance, etc. Create alarm on metric with threshold and action.
- CloudWatch Logs for log groups and streams. Send from EC2 agent or SDK. Query with Logs Insights. Set retention.
- Alarms can trigger SNS, Lambda, or Auto Scaling. Use for CPU, disk, or custom metrics. Dashboards for visualization.
Prerequisites
Steps
-
View metrics
CloudWatch Metrics. Select namespace (e.g. EC2). Select metric. View graph. Add to dashboard.
-
Create alarm
Create alarm. Choose metric and threshold. Set period and evaluation. Add SNS or action.
-
Logs
Create log group. Install agent or send from app. Set retention. Use Logs Insights to query.
Summary
CloudWatch provides metrics, logs, and alarms. Use for monitoring and alerting on AWS resources.
Prerequisites
Steps
Step 1: View metrics
CloudWatch Metrics. Select namespace and metric. View graph. Add to dashboard.
Step 2: Create alarm
Create alarm. Choose metric and threshold. Add SNS or action.
Step 3: Logs
Create log group. Install agent or send from app. Set retention. Use Logs Insights to query.
Verification
- Metrics and alarms visible. Logs arriving. Alarms trigger as configured.
Troubleshooting
No metrics — Check IAM and that agent or service is sending. Alarm not firing — Check threshold and period.