Skip to content

Latest commit

 

History

History
 
 

instrumentation-prisma-client

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

OpenTelemetry Prisma Client Instrumentation for Node.js

NPM version Apache 2.0 License

This module provides automatic instrumentation for @prisma/client.

Installation

npm install --save opentelemetry-instrumentation-prisma-client

Supported Versions

  • >=3.8.0

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();
provider.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.