Auto-instrumentation
The distribution instruments popular Node.js libraries and frameworks without code changes.
Included instrumentations
The distribution ships @opentelemetry/auto-instrumentations-node , which bundles the instrumentations from the OpenTelemetry JS contrib project.
It covers, among others, HTTP and HTTPS, Express, Fastify, Koa, Hapi, NestJS, GraphQL, gRPC, database clients such as PostgreSQL, MySQL, MongoDB and Redis, KafkaJS, the AWS SDK, and logging libraries such as Pino, Winston and Bunyan.
See the list of supported instrumentations for the complete set.
An instrumentation only becomes active when the library it instruments is loaded by the application, so carrying all of them is safe.
Instrumentations disabled by default
The file system instrumentation, @opentelemetry/instrumentation-fs, is disabled by default, because it produces a large number of spans.
Set DASH0_ENABLE_FS_INSTRUMENTATION=true to enable it.
Enabling only specific instrumentations
By default, all supported instrumentations are enabled, with the exception of @opentelemetry/instrumentation-fs.
Use the environment variable OTEL_NODE_ENABLED_INSTRUMENTATIONS to enable only certain instrumentations, by providing a comma-separated list of the instrumentation package names without the @opentelemetry/instrumentation- prefix.
For example, to enable only @opentelemetry/instrumentation-http and @opentelemetry/instrumentation-nestjs-core , set:
export OTEL_NODE_ENABLED_INSTRUMENTATIONS="http,nestjs-core"See the usage documentation of auto-instrumentations-node for more information.
This setting also applies when the SDK is configured with a declarative configuration file.
Applications that are already instrumented
If the application already loads the OpenTelemetry Node.js SDK itself, for example with --require @opentelemetry/auto-instrumentations-node/register, the distribution detects this and disables itself to prevent double instrumentation.
It logs a message when it does so.
Last updated: