Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abhiaiyer91/prisma-opentracing-middleware
Middleware for prisma that traces client operations using any opentracing based tracer
https://github.com/abhiaiyer91/prisma-opentracing-middleware
Last synced: 19 days ago
JSON representation
Middleware for prisma that traces client operations using any opentracing based tracer
- Host: GitHub
- URL: https://github.com/abhiaiyer91/prisma-opentracing-middleware
- Owner: abhiaiyer91
- Created: 2020-07-25T20:32:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T11:40:36.000Z (11 months ago)
- Last Synced: 2024-10-04T10:20:05.753Z (about 1 month ago)
- Language: TypeScript
- Size: 771 KB
- Stars: 22
- Watchers: 2
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-list - prisma-opentracing-middleware
README
# prisma-opentracing-middleware
[Prisma](https://www.prisma.io/) (2) Client middleware.
## Required Reading
Middlewares are an experimental feature. Read more about them [here](https://github.com/prisma/prisma/releases/tag/2.3.0)
## Quick Start
Install the package using `yarn`:
```bash
yarn add prisma-opentracing-middleware
```### Feature flag
Middlewares need to be enabled with the feature flag middlewares like so:```
generator client {
provider = "prisma-client-js"
previewFeatures = ["middlewares"]
}
```## Code
```js
import { PrismaClient } from "@prisma/client";
import { createTracerMiddleware } from "prisma-opentracing-middleware";
import { Tracer } from "elastic-apm-node-opentracing";const db = new PrismaClient();
const tracer = new Tracer();
db.use(createTracerMiddleware(tracer));
```