JSPM

  • Created
  • Published
  • Downloads 45525
  • Score
    100M100P100Q162477F
  • License Apache-2.0

open telemetry instrumentation for the `sequelize` module

Package Exports

  • opentelemetry-instrumentation-sequelize

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (opentelemetry-instrumentation-sequelize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

OpenTelemetry Sequelize Instrumentation for Node.js

NPM version

This module provides automatic instrumentation for Sequelize.

Tested and worked on versions v4, v5 and v6 of Sequelize.

Installation

npm install --save opentelemetry-instrumentation-sequelize

Usage

For further automatic instrumentation instruction see the @opentelemetry/instrumentation package.

const { NodeTracerProvider } = require('@opentelemetry/node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { SequelizeInstrumentation } = require('opentelemetry-instrumentation-sequelize');

const traceProvider = new NodeTracerProvider({
  // be sure to disable old plugin
  plugins: {
    sequelize: { enabled: false, path: 'opentelemetry-plugin-sequelize' }
  }
});

registerInstrumentations({
  traceProvider,
  instrumentations: [
    new SequelizeInstrumentation({
      // see under for available configuration
    })
  ]
});

Sequelize Instrumentation Options

Sequelize instrumentation has few options available to choose from. You can set the following:

Options Type Description
responseHook SequelizeResponseCustomAttributesFunction Hook called before response is returned, which allows to add custom attributes to span.
ignoreOrphanedSpans boolean Set to true if you only want to trace operation which has parent spans

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