How to build observability into a serverless application
summary
Serverless apps get automatic CloudWatch log capture but suffer data loss if metrics are batched in ephemeral containers, and high log bills (about $0.50 per GB ingested, with archival at ~$0.03/GB) if everything is verbose. Practical fixes: emit structured JSON logs, propagate correlation IDs through events, sample 1% debug traces via middleware (use middy), ship logs to a Kinesis stream for controlled concurrency and have a downstream Lambda convert logs into metrics, automate log-group subscriptions via CloudTrail and set retention to something like 7 days.
AI-written summary · about
chapters (11)
- 0:00Introduction and survivor bias
- 2:14Defining observability
- 6:29Serverless challenges for monitoring
- 9:17Lambda paradigm shifts
- 14:10Making serverless observable
- 18:42CloudWatch logs automation
- 20:07Structured logging importance
- 22:55Debug logging sampling
- 26:29Correlation IDs across services
- 29:43Custom metrics and tracing
- 31:30Key takeaways and closing
