opentelemetry-instrumentation-prisma-client
v0.4.0
Published
open telemetry instrumentation for the prisma auto-generated @prisma/client package
Downloads
5,627
Readme
IMPORTANT NOTE: PRISMA NOW HAS OFFICIAL SUPPORT FOR OPENTELEMETRY. THIS PACKAGE IS DEPRECATED.
OpenTelemetry Prisma Client Instrumentation for Node.js
This module provides automatic instrumentation for @prisma/client
.
Installation
npm install --save opentelemetry-instrumentation-prisma-client
Supported Versions
3.8.0 - 3.x
Usage
For further automatic instrumentation instruction see the @opentelemetry/instrumentation package.
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'}
| |
License
Apache 2.0 - See LICENSE for more information.