You cannot improve what you cannot measure. CloudWatch collects metrics and logs so you know HOW your systems are performing. CloudTrail records WHO did WHAT in your AWS account.
| Component | Purpose | Example |
|---|---|---|
| Metrics | Numerical data points over time | EC2 CPU: 75%, Lambda errors: 5/minute |
| Alarms | Alert or take action when metric breaches threshold | CPU > 80% for 5 minutes → send SNS email |
| Logs | Text output from applications and AWS services | Application errors, access logs, VPC flow logs |
| Logs Insights | SQL-like queries on log data | Find all ERROR messages in the last hour |
| Dashboards | Visual graphs for metrics and alarms | Operations team monitoring screen |
| Anomaly Detection | ML-based baseline — alert on unusual patterns | Detect unusual spikes in API errors |
CloudTrail records EVERY API call made in your AWS account — Console clicks, CLI commands, SDK calls, and automated service actions. Essential for:
| CloudWatch | CloudTrail | |
|---|---|---|
| Answers | HOW is my system performing? | WHO did WHAT in my account? |
| Data | Metrics, logs, events | API calls and management events |
| Example | Lambda error rate is 5% | Alice deleted the production S3 bucket at 3:42pm |