Consists of a sample project using a Node.js/Express service that exposes data with express-prom-bundle (built on top of prom-client). It also contains a docker-compose 🐋 file that deploys two other containers - a Prometheus server and a Grafana server -, so we can collect the service data and use it to generate dashboards and graphs.
- Create a directory named
grafana
- Give permissions to this directory
sudo chmod 744 grafana
- Build the application image using the Docker CLI:
npm run buildImage
- Use docker-compose 🐋 to run the application and the Grafana and Prometheus servers:
docker-compose up
- Access
http://localhost:3000
in your browser and log in to the Grafana console - Create a new Prometheus datasource using the following URL:
http://prometheus:9090
- Create a new dashboard and new panels using the Prometheus datasource to visualize the data exposed by the Node.js/Express application