Reference code for "Database Metrics with Prisma, Prometheus & Grafana".
This branch reflects the code at the end of the tutorial.
For reference express server used at the beginning of the tutorial go to the metrics-begin
branch.
- Clone this repository:
git clone git@github.com:TasinIshmam/metrics-tutorial-prisma.git
. - Navigate to the cloned directory:
cd metrics-tutorial-prisma
. - Install dependencies:
npm install
. - Start the PostgreSQL, Prometheus and Grafana with Docker:
docker-compose up --force-recreate
. - Run migrations:
npx prisma migrate dev
. - Start the server:
npm run dev
. - Test the API endpoints using the load testing script:
npm run loadtest
. - Access Prometheus in
http://localhost:9090
. - Access Grafana in
http://localhost:3000
.
More information about configuring Grafana is available starting with this section of the tutorial.