This is an example Node.js application. This application creates REST APIs using Express.js and monitors the application through Prometheus and Grafana.
These instructions will help you to run the project on your local machine.
To run this project locally, you must have the following software components installed:
- Node.js
- Docker and Docker Compose
Follow the below steps to run this project on your local machine:
- Clone the repository to your local machine.
- Open the terminal and navigate to the root directory of the project.
- Run the command
npm install
. - Run the command
npm start
.
Alternatively, if you want to run the project on Docker, follow the below steps:
- Clone the repository to your local machine.
- Open the terminal and navigate to the root directory of the project.
- Run the command
docker-compose up
.
After running this project locally, you can access its REST APIs at http://localhost:3000
.
You can monitor this project through Prometheus and Grafana. Prometheus runs at http://localhost:9090
, while Grafana runs at http://localhost:3001
. Additionally, you can find ready-to-use Grafana dashboard templates in the metrics
folder in the project. You can import these templates into Grafana and use them to monitor the metrics of your Node.js application.
To import a template in Grafana, follow these steps:
- Open the Grafana web interface at
http://localhost:3001
. - Click on the "+" icon in the left menu and select "Import".
- In the "Import" section, click on the "Upload JSON File" button and select a JSON file from the
metrics
folder. - Configure the dashboard settings as needed and click on the "Import" button.
After importing the template, you will have a fully functional Grafana dashboard to monitor your Node.js application.
This project is licensed under the MIT License. See the LICENSE
file for details.