In this chapter, we covered general best practices when deploying serverless applications and error tracking. We looked at examples of how to integrate Rollbar and Sentry, two error tracking and reporting services, in AWS Lambda functions so that unexpected errors do not go unnoticed. We also discussed some strategies regarding application logging and methods to ensure you get the metrics and telemetry you need. We also addressed the issue of cold starts in cloud functions, and we discussed ways of working around them. From there, we walked through some techniques to help you with local testing and setting up serverless functions and systems. Finally, we reviewed the management of different environments or stacks using environment variables and the encryption of sensitive variables using AWS's Key Management Service.
Best practices for serverless applications could...