npm.io
0.2.0 • Published 5 years ago

opentelemetry-plugin-sequelize

Licence
Apache-2.0
Version
0.2.0
Deps
4
Size
65 kB
Vulns
0
Weekly
0
Stars
168
DeprecatedThis package is deprecated

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

Usage

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

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

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

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

Keywords