A production application went down and was recovered six hours later after users started reaching support and developers rebooted the app. This happen

Setting up monitoring with NestJS, Prometheus and Grafana

submited by
Style Pass
2024-10-22 12:00:03

A production application went down and was recovered six hours later after users started reaching support and developers rebooted the app. This happened on a real production system at my friend’s company. Money was lost, the customers were angry, and the developers scratched their heads about how it could happen. This is an excellent example of how monitoring and alerting could have solved the problem or reduced the downtime to the minimum. Sometimes developers neglect these tools to move faster, but having them for any production system is essential. In this article, I will follow you through setting up metrics and monitoring using a NestJS web application. No sophisticated setup is needed; everything is done on a local machine with the help of Docker.

Let’s start with setting up a Node.js/NestJS application that will expose a REST API. I will name the app metr101. Execute the following command and select npm when prompted to choose a package manager:

Leave a Comment