
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
opentelemetry-instrumentation-typeorm
Advanced tools
open telemetry instrumentation for the `typeorm` module
This module provides automatic instrumentation for TypeORM.
npm install --save opentelemetry-instrumentation-typeorm
This instrumentation supports >0.2.28:
For further automatic instrumentation instruction see the @opentelemetry/instrumentation package.
const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { TypeormInstrumentation } = require('opentelemetry-instrumentation-typeorm');
const tracerProvider = new NodeTracerProvider({
// be sure to disable old plugin
plugins: {
typeorm: { enabled: false, path: 'opentelemetry-plugin-typeorm' }
}
});
registerInstrumentations({
tracerProvider,
instrumentations: [
new TypeormInstrumentation({
// see under for available configuration
})
]
});
TypeORM instrumentation has few options available to choose from. You can set the following:
| Options | Type | Description |
|---|---|---|
responseHook | TypeormResponseCustomAttributesFunction | Hook called before response is returned, which allows to add custom attributes to span. |
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 |
suppressInternalInstrumentation | boolean | Typeorm operation use mongodb/postgres/mysql/mariadb/etc. under the hood. If, for example, postgres instrumentation is enabled, a postgres operation will also create a postgres span describing the communication. Setting the suppressInternalInstrumentation config value to true will cause the instrumentation to suppress instrumentation of underlying operations. |
enableInternalInstrumentation | boolean | Some methods such as getManyAndCount can generate internally multiple spans. To instrument those set this to true |
collectParameters | boolean | set to true if you want to capture the parameter values for parameterized SQL queries (may leak sensitive information) |
This extension (and many others) was developed by Aspecto with ❤️
FAQs
open telemetry instrumentation for the `typeorm` module
The npm package opentelemetry-instrumentation-typeorm receives a total of 58,048 weekly downloads. As such, opentelemetry-instrumentation-typeorm popularity was classified as popular.
We found that opentelemetry-instrumentation-typeorm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.