Debugging serverless applications in production can be difficult, as in this case, there is no access to the runtime environment and infrastructure that is running your code. With that in mind, there are some useful tools available today and probably more on the way, as the space continues to mature:
Records recorded in stdout and stderr are sent to the platform, and there is usually a record service integration that collects them for you. For example, IBM Cloud Functions supports IBM Log Analysis with LogDNA service, which collects these logs and allows you to use them to help correct problems.
You may be interested in knowing information such as invocation status, any errors in invocation, start and end times for your actions and cold start times for your actions. These types of high-level metrics, in general, are automatically integrated into your serverless platform. Most cloud providers send this metric data to a monitoring service, where you are able to set up dashboards to monitor your actions. IBM Cloud Functions sends metrics to IBM Cloud Monitoring and can be viewed using Grafana. Grafana allows you to configure dashboards, create alerts based on metric event values, and more.
You may also want to make corrections during the development process. The wskdebug tool was recently introduced to the Apache OpenWhisk community. It supports full debugging of actions, automatic reloading of code, automatic invocation of actions on code changes and much more. It currently supports out-of-the-box Node.js actions, but other languages can also be configured via the command line.
Want to read more specialized programming content? Discover the IBM Blue Profile and access exclusive materials, new knowledge journeys and personalized tests. Check it out right now, get the badges and upgrade your career!