open telemetry instrumentation for the prisma auto-generated @prisma/client package
npm install opentelemetry-instrumentation-prisma-clientThis module provides automatic instrumentation for @prisma/client.
```
npm install --save opentelemetry-instrumentation-prisma-client
Usage
For further automatic instrumentation instruction see the @opentelemetry/instrumentation package.`js
const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { PrismaClientInstrumentation } = require('opentelemetry-instrumentation-prisma-client');const tracerProvider = new NodeTracerProvider();
tracerProvider.register();
registerInstrumentations({
instrumentations: [
new PrismaClientInstrumentation()
]
});
`Configuration
| Name | Type | Default Value | Description | |
|----------------|-------------------------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------|--|
| spanAttributes | Attributes |
undefined | An optional set of Opentelemetry Attributes to be added to the span. For example spanAttributes: {[SemanticAttributes.DB_SYSTEM]: 'postgresql'}` | |