CloudWatch & Sentry
Log Groups
| Log Group | Source |
|---|---|
/aws/ec2/statux-prod | EC2 instance logs |
/aws/ec2/statux-prod-pages-api | Statux Pages API container logs |
/aws/ec2/statux-prod-alerts-api | Alerting API container logs |
/aws/ec2/statux-prod-synthetics-api | Synthetics API container logs |
/aws/ec2/statux-prod-insights-api | Insights API container logs |
/aws/ec2/statux-prod-platform-api | Platform API container logs |
View Logs
# Follow logs for a specific API
aws logs tail /aws/ec2/statux-prod-alerts-api --follow
# Search for errors
aws logs filter-log-events \
--log-group-name /aws/ec2/statux-prod-alerts-api \
--filter-pattern "ERROR"
You can also view container logs directly on the EC2 instance:
# SSH via SSM, then:
sudo docker logs --tail 100 <container-id> 2>&1 | grep -i error
CloudWatch Alarms
| Alarm | Threshold | Action |
|---|---|---|
| ASG Max Capacity | >= 2 instances | SNS notification |
| SES Bounce Rate | > 5% | SNS notification |
| SES Complaint Rate | > 0.1% | SNS notification |
Sentry Error Tracking
All 5 APIs report 500+ errors to Sentry automatically:
- Sentry project:
allstatux(single project for all APIs) - How it works:
HttpExceptionFilter(applied globally) callscaptureException()for any error with status >= 500, including request context (URL, method, user ID) - Initialization: Each API calls
initSentry()inmain.tswith the DSN from Secrets Manager
Sentry Dashboard
View errors, stack traces, and trends at the Sentry web dashboard. Errors are tagged with the service name (e.g., alerting-api, statuspages-api) for filtering.
When to Use What
| Scenario | Tool |
|---|---|
| Application errors (500s, exceptions) | Sentry |
| Container startup issues, crashes | CloudWatch Logs |
| Infrastructure metrics (CPU, memory) | CloudWatch Metrics |
| Email delivery issues | CloudWatch Alarms (SES bounce/complaint) |
| API request debugging | CloudWatch Logs + Sentry |
SES Monitoring
AWS SES email delivery is monitored via CloudWatch:
- Bounce rate alarm triggers if bounces exceed 5% (SES suspension risk at 10%)
- Complaint rate alarm triggers if complaints exceed 0.1% (SES suspension risk at 0.5%)
- SES configuration set
statux-production-v2routes delivery events to CloudWatch