Monitoring
What exists in repo and deploy config today—not aspirational dashboards.
Workloads and logs
| Workload | SERVICE_NAME | Logs |
|---|---|---|
| HTTP API | sophia-api | Pino → stdout → CloudWatch (default for Fargate) |
| Interview settlement Lambda | sophia-interview-completed | Same + consumer, messageId |
| Report Lambda | sophia-report-generate | Same |
No custom log groups, retention, or subscription filters defined in infrastructure code.
What exists
| Signal | Detail |
|---|---|
| ALB health | GET /health every 30s; 200 even if Mongo degraded |
| ECS scaling (prod) | CPU ~65%, memory ~75%, 2–6 tasks |
| SQS + DLQ | Two primary queues; DLQ after 3 receives; 14-day DLQ retention |
| Lambda batch | Partial batch failures enabled for retries |
| Smoke test | pnpm smoke — health, hello, validation, 404 envelope, CORS |
| Log fields | event, requestId, status, durationMs, method, path on request completion |
What does not exist (in repo)
| Gap | Detail |
|---|---|
| CloudWatch alarms | No DLQ depth, error rate, or latency alarms in infra |
| Custom metrics | No app-emitted metrics or EMF |
| Distributed tracing | No OpenTelemetry or X-Ray; only requestId |
| DLQ automation | No replay script or auto-redrive |
| Front-end RUM | Web on Cloudflare Pages; no error pipeline defined here |
Queues (operational)
Check primary queue depth and oldest message age. Any message in InterviewCompletedDlq or ReportGenerateDlq means repeated handler failure—investigate Lambda ERROR logs by messageId and requestId.
Schema-invalid SQS messages are discarded in code and will not land in DLQ via retries.