Skip to content

Commit 42f5214

Browse files
authored
Update README.md (#1748)
* Update README.md * Explicitly specify instrumentation packages * Formatting * Remove outdated sample containing broken link that no longer exists from README, fixes check-links * Clarify wording
1 parent 533f67c commit 42f5214

File tree

1 file changed

+55
-3
lines changed

1 file changed

+55
-3
lines changed

nodejs/README.md

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,61 @@ 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 included and loaded automatically by default.
12+
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)
13+
are also included.
14+
15+
Following instrumentations from the metapackage are included:
16+
- `amqplib`
17+
- `bunyan`
18+
- `cassandra-driver`
19+
- `connect`
20+
- `dataloader`
21+
- `dns` *- default*
22+
- `express` *- default*
23+
- `fs`
24+
- `graphql` *- default*
25+
- `grpc` *- default*
26+
- `hapi` *- default*
27+
- `http` *- default*
28+
- `ioredis` *- default*
29+
- `kafkajs`
30+
- `knex`
31+
- `koa` *- default*
32+
- `memcached`
33+
- `mongodb` *- default*
34+
- `mongoose`
35+
- `mysql` *- default*
36+
- `mysql2`
37+
- `nestjs-core`
38+
- `net` *- default*
39+
- `pg` *- default*
40+
- `pino`
41+
- `redis` *- default*
42+
- `restify`
43+
- `socket.io`
44+
- `undici`
45+
- `winston`
46+
47+
Instrumentations annotated with "*- default*" are loaded by default.
48+
49+
To only load specific instrumentations, specify the `OTEL_NODE_ENABLED_INSTRUMENTATIONS` environment variable in the lambda configuration.
50+
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.
51+
52+
The environment variables should be set to a comma-separated list of the instrumentation package names without the
53+
`@opentelemetry/instrumentation-` prefix.
54+
55+
For example, to enable only `@opentelemetry/instrumentation-http` and `@opentelemetry/instrumentation-undici`:
56+
```shell
57+
OTEL_NODE_ENABLED_INSTRUMENTATIONS="http,undici"
58+
```
59+
To disable only `@opentelemetry/instrumentation-net`:
60+
```shell
61+
OTEL_NODE_DISABLED_INSTRUMENTATIONS="net"
62+
```
1063

1164
## Building
1265

@@ -31,5 +84,4 @@ You'll find the generated layer zip file at `./packages/layer/build/layer.zip`.
3184
Sample applications are provided to show usage of the above layer.
3285

3386
- Application using AWS SDK - shows using the wrapper with an application using AWS SDK without code change.
34-
- [Using layer built from source](./integration-tests/aws-sdk)
3587
- [WIP] [Using OTel Public Layer](./sample-apps/aws-sdk)

0 commit comments

Comments
 (0)