One of the challenges when working with the Serverless Framework and lambda is how to monitor your software. There exist various solutions for this, but nearly all of them require time and work to instrument your codebase. Today I will show you how in 2 minutes, with zero instrumentation, you can add monitoring to your existing Serverless project.
First, make sure you have your terminal open in the directory containing your Serverless project. Then run the serverless
command without any arguments. You will then be presented with an interactive set of prompts to configure your service for monitoring! Create an account and it will handle the rest for you.
Then run serverless deploy
to redeploy your project with monitoring enabled. After that, you can open the monitoring dashboard for your service by running serverless dashboard
.