Skip to content

Commit 0f18399

Browse files
authored
Update README.md
1 parent bf486b3 commit 0f18399

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

nodejs/README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,42 @@ the `AWS_LAMBDA_EXEC_WRAPPER` environment variable will initialize OpenTelemetry
55

66
To use, add the layer to your function configuration and then set `AWS_LAMBDA_EXEC_WRAPPER` to `/opt/otel-handler`.
77

8-
[AWS SDK v2 instrumentation](https://github.com/aspecto-io/opentelemetry-ext-js/tree/master/packages/instrumentation-aws-sdk) is also
9-
included and loaded automatically if you use the AWS SDK v2.
8+
## Configuring auto instrumentation
9+
10+
[AWS SDK v3 instrumentation](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-aws-sdk)
11+
is loaded automatically by default.
12+
The instrumentations from the [OTEL auto-instrumentations-node metapackage](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node)
13+
are also included, except for `cucumber, generic-pool, lru-memoizer`.
14+
15+
Following instrumentations from the metapackage are automatically loaded by default:
16+
- `dns`
17+
- `express`
18+
- `graphql`
19+
- `grpc`
20+
- `hapi`
21+
- `http`
22+
- `ioredis`
23+
- `koa`
24+
- `mongodb`
25+
- `mysql`
26+
- `net`
27+
- `pg`
28+
- `redis`
29+
30+
To only load specific instrumentations, specify the `OTEL_NODE_ENABLED_INSTRUMENTATIONS` environment variable in the lambda configuration.
31+
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.
32+
33+
The environment variables should be set to a comma-separated list of the instrumentation package names without the
34+
`@opentelemetry/instrumentation-` prefix.
35+
36+
For example, to enable only `@opentelemetry/instrumentation-http` and `@opentelemetry/instrumentation-undici`:
37+
```shell
38+
OTEL_NODE_ENABLED_INSTRUMENTATIONS="http,undici"
39+
```
40+
To disable only `@opentelemetry/instrumentation-net`:
41+
```shell
42+
OTEL_NODE_DISABLED_INSTRUMENTATIONS="net"
43+
```
1044

1145
## Building
1246

0 commit comments

Comments
 (0)