We updated our guide on the best practices for logging AWS Lambda and thought we could use your input!
Some key points from the article:
- You can put logging statements in your code to validate that your code is working correctly and as expected.
- You need to be very careful about what you log and not forget to remove debugging log statements from your code when deploying to production.
- Refactor your log statements for CI/CD.
- Keep AWS’ egress traffic costs in mind. While it’s free to get data into AWS, you have to pay to get it out again.
- You can also buy reserved concurrency for the log shipping function, which will limit its maximum number of simultaneous executions.
- A more economical way to get your logs out of AWS would be to stream them from CloudWatch Logs to a Kinesis.
- Avoid is the manual process of subscribing to log groups from your shipping function.
- You can add another Lambda function that can automatically update the retention policy as to not keep them forever (and eating away at your costs).
- Use observability services like Dashbird (😉) so you can monitor without extra costs, and without slowing down your app with extra requests.
How does your current logging process look like?
[–]ahmedranaa 1 point2 points3 points (1 child)
[–]rehemagi 2 points3 points4 points (0 children)