opentelemetry-js/packages/opentelemetry-plugin-mysql
Daniel Dyla 9a3fd7b560
Rename scope to context (#853)
2020-03-13 15:01:07 -04:00
..
src feat: use context-based tracing (#816) 2020-03-02 13:47:35 -05:00
test Rename scope to context (#853) 2020-03-13 15:01:07 -04:00
.npmignore feat: mysql support (#525) 2019-11-27 11:25:29 -08:00
LICENSE feat: mysql support (#525) 2019-11-27 11:25:29 -08:00
README.md chore: rename registry to provider (#749) 2020-02-03 10:36:12 -08:00
package.json Rename scope to context (#853) 2020-03-13 15:01:07 -04:00
tsconfig.json feat: mysql support (#525) 2019-11-27 11:25:29 -08:00
tslint.json feat: mysql support (#525) 2019-11-27 11:25:29 -08:00

README.md

OpenTelemetry mysql Instrumentation for Node.js

Gitter chat dependencies devDependencies Apache License

This module provides automatic instrumentation for mysql.

For automatic instrumentation see the @opentelemetry/node package.

Installation

npm install --save @opentelemetry/plugin-mysql

Supported Versions

  • ~2.0.0

Usage

OpenTelemetry MySQL Instrumentation allows the user to automatically collect trace data and export them to the backend of choice, to give observability to distributed systems when working with mysql.

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

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

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

To load all of the supported plugins, use below approach. Each plugin is only loaded when the module that it patches is loaded; in other words, there is no computational overhead for listing plugins for unused modules.

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

const provider = new NodeTracerProvider();

See examples/mysql for a short example.

License

Apache 2.0 - See LICENSE for more information.