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
This module provides automatic instrumentation for Sequelize.
Tested and worked on versions v4, v5 and v6 of Sequelize.
Installation
npm install --save opentelemetry-instrumentation-sequelizeUsage
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 |
moduleVersionAttributeName |
string |
If passed, a span attribute will be added to all spans with key of the provided moduleVersionAttributeName and value of the patched module version |
Semantic Behavior
Internal implementation queries generated on startup from connection-manager are not instrumented.
This extension (and many others) was developed by Aspecto with ❤️