As a developer, I love Lambda functions. They allow me to focus on the purpose of the functionality and save tons of time writing and deploying code. At the same time, one of the biggest challenges of using Lambda functions in production has been the troubleshooting of issues. This stems from a visibility gap between the code and how the user experiences the application and a lack of monitoring tools that specifically address this key problem in serverless environments.
Certainly, Amazon’s monitoring tool CloudWatch provides a way to track function metrics and deep dive in the logs for debugging. However, combing through logs is not how I want to debug my issues — it takes _hours. _
I took a look at a number of tools that help you set up log forwarding, to monitor errors and exceptions. Here’s how they typically work:
This process works great. I was able to set up error monitoring in a few minutes without changing my code. In addition, I now had stack traces and interesting function details like:
Now, here are the challenges with the approach:
assumeRole
to access my account info.So, while log forwarding from CloudWatch is better than using the CloudWatch itself, it is not without flaws.
#monitoring #serverless #node #cloudwatch