From 0f18399c18524ce894d121bfeec38876d268ba48 Mon Sep 17 00:00:00 2001 From: wpessers <45464718+wpessers@users.noreply.github.com> Date: Sun, 23 Mar 2025 17:23:37 +0100 Subject: [PATCH 1/5] Update README.md --- nodejs/README.md | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/nodejs/README.md b/nodejs/README.md index cb2af9ec5c..86223842b4 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -5,8 +5,42 @@ the `AWS_LAMBDA_EXEC_WRAPPER` environment variable will initialize OpenTelemetry To use, add the layer to your function configuration and then set `AWS_LAMBDA_EXEC_WRAPPER` to `/opt/otel-handler`. -[AWS SDK v2 instrumentation](https://github.com/aspecto-io/opentelemetry-ext-js/tree/master/packages/instrumentation-aws-sdk) is also -included and loaded automatically if you use the AWS SDK v2. +## Configuring auto instrumentation + +[AWS SDK v3 instrumentation](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-aws-sdk) +is loaded automatically by default. +The instrumentations from the [OTEL auto-instrumentations-node metapackage](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node) +are also included, except for `cucumber, generic-pool, lru-memoizer`. + +Following instrumentations from the metapackage are automatically loaded by default: +- `dns` +- `express` +- `graphql` +- `grpc` +- `hapi` +- `http` +- `ioredis` +- `koa` +- `mongodb` +- `mysql` +- `net` +- `pg` +- `redis` + +To only load specific instrumentations, specify the `OTEL_NODE_ENABLED_INSTRUMENTATIONS` environment variable in the lambda configuration. +This disables all the defaults mentioned above, and only enable the ones you specify. Selectively disabling instrumentations from the defaults is also possible with the `OTEL_NODE_DISABLED_INSTRUMENTATIONS` environment variable. + +The environment variables should be set to 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-undici`: +```shell +OTEL_NODE_ENABLED_INSTRUMENTATIONS="http,undici" +``` +To disable only `@opentelemetry/instrumentation-net`: +```shell +OTEL_NODE_DISABLED_INSTRUMENTATIONS="net" +``` ## Building From a7f599ee494053782c329551717f9c295748076f Mon Sep 17 00:00:00 2001 From: warre Date: Tue, 25 Mar 2025 08:47:34 +0100 Subject: [PATCH 2/5] Explicitly specify instrumentation packages --- nodejs/README.md | 56 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/nodejs/README.md b/nodejs/README.md index 86223842b4..0f2efaa535 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -9,26 +9,44 @@ To use, add the layer to your function configuration and then set `AWS_LAMBDA_EX [AWS SDK v3 instrumentation](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-aws-sdk) is loaded automatically by default. -The instrumentations from the [OTEL auto-instrumentations-node metapackage](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node) -are also included, except for `cucumber, generic-pool, lru-memoizer`. - -Following instrumentations from the metapackage are automatically loaded by default: -- `dns` -- `express` -- `graphql` -- `grpc` -- `hapi` -- `http` -- `ioredis` -- `koa` -- `mongodb` -- `mysql` -- `net` -- `pg` -- `redis` - +A subset of instrumentations from the [OTEL auto-instrumentations-node metapackage](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node) +are also included. + +Following instrumentations from the metapackage are included: +- `amqplib` +- `bunyan` +- `cassandra-driver` +- `connect` +- `dataloader` +- `dns` *- default* +- `express` *- default* +- `fs` +- `graphql` *- default* +- `grpc` *- default* +- `hapi` *- default* +- `http` *- default* +- `ioredis` *- default* +- `kafkajs` +- `knex` +- `koa` *- default* +- `memcached` +- `mongodb` *- default* +- `mongoose` +- `mysql` *- default* +- `mysql2` +- `nestjs-core` +- `net` *- default* +- `pg` *- default* +- `pino` +- `redis` *- default* +- `restify` +- `socket.io` +- `undici` +- `winston` + +Instrumentations annotated with "*- default*" are loaded by default. To only load specific instrumentations, specify the `OTEL_NODE_ENABLED_INSTRUMENTATIONS` environment variable in the lambda configuration. -This disables all the defaults mentioned above, and only enable the ones you specify. Selectively disabling instrumentations from the defaults is also possible with the `OTEL_NODE_DISABLED_INSTRUMENTATIONS` environment variable. +This disables all the defaults, and only enables the ones you specify. Selectively disabling instrumentations from the defaults is also possible with the `OTEL_NODE_DISABLED_INSTRUMENTATIONS` environment variable. The environment variables should be set to a comma-separated list of the instrumentation package names without the `@opentelemetry/instrumentation-` prefix. From 4d762437c48e10befe9b14360ef39b219b055452 Mon Sep 17 00:00:00 2001 From: warre Date: Tue, 25 Mar 2025 08:54:25 +0100 Subject: [PATCH 3/5] Formatting --- nodejs/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/nodejs/README.md b/nodejs/README.md index 0f2efaa535..91c534498c 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -45,6 +45,7 @@ Following instrumentations from the metapackage are included: - `winston` Instrumentations annotated with "*- default*" are loaded by default. + To only load specific instrumentations, specify the `OTEL_NODE_ENABLED_INSTRUMENTATIONS` environment variable in the lambda configuration. This disables all the defaults, and only enables the ones you specify. Selectively disabling instrumentations from the defaults is also possible with the `OTEL_NODE_DISABLED_INSTRUMENTATIONS` environment variable. From 2c9eb201ff0280b77a81b338e8f33789797cd54b Mon Sep 17 00:00:00 2001 From: warre Date: Tue, 25 Mar 2025 08:55:49 +0100 Subject: [PATCH 4/5] Remove outdated sample containing broken link that no longer exists from README, fixes check-links --- nodejs/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/nodejs/README.md b/nodejs/README.md index 91c534498c..ef0653831f 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -84,5 +84,4 @@ You'll find the generated layer zip file at `./packages/layer/build/layer.zip`. Sample applications are provided to show usage of the above layer. - Application using AWS SDK - shows using the wrapper with an application using AWS SDK without code change. - - [Using layer built from source](./integration-tests/aws-sdk) - [WIP] [Using OTel Public Layer](./sample-apps/aws-sdk) From 8e652f193d27a11862734001220324366028ce0e Mon Sep 17 00:00:00 2001 From: warre Date: Tue, 25 Mar 2025 09:16:49 +0100 Subject: [PATCH 5/5] Clarify wording --- nodejs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs/README.md b/nodejs/README.md index ef0653831f..45a9d671f8 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -8,7 +8,7 @@ To use, add the layer to your function configuration and then set `AWS_LAMBDA_EX ## Configuring auto instrumentation [AWS SDK v3 instrumentation](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-aws-sdk) -is loaded automatically by default. +is included and loaded automatically by default. A subset of instrumentations from the [OTEL auto-instrumentations-node metapackage](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node) are also included.