https://github.com/prisma/metrics-tutorial-prisma
Database Metrics with Prisma, Prometheus & Grafana
https://github.com/prisma/metrics-tutorial-prisma
Last synced: 11 months ago
JSON representation
Database Metrics with Prisma, Prometheus & Grafana
- Host: GitHub
- URL: https://github.com/prisma/metrics-tutorial-prisma
- Owner: prisma
- Created: 2022-09-28T10:23:35.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-18T22:17:51.000Z (over 3 years ago)
- Last Synced: 2025-06-22T01:46:59.582Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://www.prisma.io/blog/metrics-tutorial-prisma-pmoldgq10kz
- Size: 119 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Prisma metrics tutorial
Reference code for ["Database Metrics with Prisma, Prometheus & Grafana"](https://www.prisma.io/blog/metrics-tutorial-prisma-pmoldgq10kz).
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`](https://github.com/TasinIshmam/metrics-tutorial-prisma/tree/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`](http://localhost:9090).
9. Access Grafana in [`http://localhost:3000`](http://localhost:3000).
More information about configuring Grafana is available starting with [this section](https://prisma.io/blog/metrics-tutorial-prisma-pmoldgq10kz#add-a-prometheus-data-source-to-grafana) of the tutorial.