0.3.0 • Published 7 months ago

opentelemetry-instrumentation-prisma-client v0.3.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

IMPORTANT NOTE: PRISMA NOW HAS OFFICIAL SUPPORT FOR OPENTELEMETRY. THIS PACKAGE IS DEPRECATED.

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 - 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

NameTypeDefault ValueDescription
spanAttributesAttributesundefinedAn 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.