Production readiness — Section 12: Observability
Better than initially thought: structured JSON logs (with PII/secret scrubbing already implemented) are live in CloudWatch (/musehub/staging, ~1.7GB and growing). What is missing is entirely on top of that existing data: metric filters, alarms, SNS topics, dashboards, external uptime checks, and error tracking.
Quick wins: fix deploy/cloudwatch-alerts.sh (targets the wrong log group name, /musehub/app instead of the real /musehub/staging), set an explicit log retention period (currently unlimited).
Wired real alerting on top of the already-solid logging foundation.
Fixed real bugs in deploy/cloudwatch-alerts.sh, beyond the known log-group-name issue:
- Wrong default region (
eu-west-1— everything here runs inus-east-1) - A metric-alarm call that would fail at runtime (
--statistic+--extended-statisticare mutually exclusive) — found by actually running the script - A DB-connections alarm pointed at
AWS/RDSthat could never fire — this project uses self-hosted Postgres on EC2, not RDS. Removed rather than left silently broken. - CloudWatch Agent install instructions used
yum(Amazon Linux) — these instances run Ubuntu. Corrected. - Single-email alerting → now routes to both Gabriel and Aaron by default
Ran it for real against both environments, verified via aws logs/aws cloudwatch describe-* directly: 30-day log retention set, SNS topics with both maintainers subscribed, 3 metric filters and 2 alarms (5xx rate, p99 latency) live on each. You'll each need to confirm the SNS email subscription AWS sent.
Added environment/release_version to every log line — verified end-to-end locally, takes effect on the next deploy to each environment.
Remaining work (CloudWatch Agent install, external uptime, error tracking, dashboards) needs real tool/cost decisions — split to #181.
Closing.
Update 2026-08-25: Fixed the exact issue this ticket flagged —
/musehub/staginghad unlimited retention and was already at ~1.9GB. Set explicit 30-day retention (matching the policy already applied to/musehub/productionfrom day one). AWS prunes existing data older than the new retention window asynchronously (not instant, typically within 24h), so this both stops future unbounded growth and will shrink the current stored bytes down without further action.Alarms/dashboards/metric-filters/SNS topics on top of this data — and fixing
deploy/cloudwatch-alerts.sh's wrong log-group-name reference — remain open.