/metrics-tutorial-prisma

Database Metrics with Prisma, Prometheus & Grafana

Primary LanguageTypeScript

Prisma metrics tutorial

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.

Installation

  1. Clone this repository: git clone git@github.com:TasinIshmam/metrics-tutorial-prisma.git.
  2. Navigate to the cloned directory: cd metrics-tutorial-prisma.
  3. Install dependencies: npm install.
  4. Start the PostgreSQL, Prometheus and Grafana with Docker: docker-compose up --force-recreate.
  5. Run migrations: npx prisma migrate dev.
  6. Start the server: npm run dev.
  7. Test the API endpoints using the load testing script: npm run loadtest.
  8. Access Prometheus in http://localhost:9090.
  9. Access Grafana in http://localhost:3000.

More information about configuring Grafana is available starting with this section of the tutorial.