Skip to content

Commit

Permalink
doc(k8s-operator): document customizing enabled auto-instrumentations…
Browse files Browse the repository at this point in the history
… for nodejs with kubernetes-operator

Closes 4130
  • Loading branch information
atsu85 committed Apr 11, 2024
1 parent 14d5fbf commit 30c355a
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions content/en/docs/kubernetes/operator/automatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,22 @@ must be able to receive OTLP over `grpc`. Therefore, the example uses

#### Excluding auto-instrumentation {#js-excluding-auto-instrumentation}

By default, the Node.js auto-instrumentation ships with
[many instrumentation libraries](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/metapackages/auto-instrumentations-node/README.md#supported-instrumentations).
At the moment, there is no way to opt-in to only specific packages or disable
specific packages. If you don't want to use a package included by the default
image you must either supply your own image that includes only the packages you
want or use manual instrumentation.
By default, the Node.js auto-instrumentation has all the instrumentation libraries enabled.

To enable only specific instrumentations you can use the `OTEL_NODE_ENABLED_INSTRUMENTATIONS` environment variable as documented in the
[Node.js auto-instrumentation documentation](/docs/languages/js/automatic/configuration/#excluding-auto-instrumentation).

```yaml
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
# ... other fields skipped from this example
spec:
# ... other fields skipped from this example
nodejs:
env:
- name: OTEL_NODE_ENABLED_INSTRUMENTATIONS
value: http,nestjs-core # comma-separated list of the instrumentation package names without the `@opentelemetry/instrumentation-` prefix.
```
#### Learn more {#js-learn-more}
Expand Down

0 comments on commit 30c355a

Please sign in to comment.