0.2.0 • Published 3 years ago

opentelemetry-plugin-typeorm v0.2.0

Weekly downloads
442
License
Apache-2.0
Repository
github
Last release
3 years ago

OpenTelemetry TypeORM Instrumentation for Node.js

NPM version

This module provides automatic instrumentation for TypeORM.

Installation

npm install --save opentelemetry-plugin-typeorm

Usage

To load a specific plugin (typeorm in this case), specify it in the Node Tracer's configuration

const { NodeTracerProvider } = require("@opentelemetry/node");

const provider = new NodeTracerProvider({
  plugins: {
    typeorm: {
      enabled: true,
      // You may use a package name or absolute path to the file.
      path: "opentelemetry-plugin-typeorm",
    },
  },
});

TypeORM Plugin Options

TypeORM plugin has few options available to choose from. You can set the following:

OptionsTypeDescription
responseHookTypeormResponseCustomAttributesFunctionHook called before response is returned, which allows to add custom attributes to span.

This extension (and many others) was developed by Aspecto with ❤️