Skip to content

Commit beab727

Browse files
committed
doc(k8s-operator): document customizing enabled auto-instrumentations for nodejs with kubernetes-operator
Closes 4130
1 parent bb28bfa commit beab727

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

content/en/docs/kubernetes/operator/automatic.md

+19-6
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,25 @@ must be able to receive OTLP over `grpc`. Therefore, the example uses
282282

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

285-
By default, the Node.js auto-instrumentation ships with
286-
[many instrumentation libraries](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/metapackages/auto-instrumentations-node/README.md#supported-instrumentations).
287-
At the moment, there is no way to opt-in to only specific packages or disable
288-
specific packages. If you don't want to use a package included by the default
289-
image you must either supply your own image that includes only the packages you
290-
want or use manual instrumentation.
285+
By default, the Node.js auto-instrumentation has all the
286+
[supported instrumentation libraries](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/metapackages/auto-instrumentations-node/README.md#supported-instrumentations)
287+
enabled.
288+
This makes instrumentation easy, but can result in very slow application startup time and collecting too much or unwanted data.
289+
290+
To enable only specific instrumentations you can use the `OTEL_NODE_ENABLED_INSTRUMENTATIONS` environment variable as documented in the
291+
[Node.js auto-instrumentation documentation](/docs/languages/js/automatic/configuration/#excluding-auto-instrumentation).
292+
293+
```yaml
294+
apiVersion: opentelemetry.io/v1alpha1
295+
kind: Instrumentation
296+
# ... other fields skipped from this example
297+
spec:
298+
# ... other fields skipped from this example
299+
nodejs:
300+
env:
301+
- name: OTEL_NODE_ENABLED_INSTRUMENTATIONS
302+
value: http,nestjs-core # comma-separated list of the instrumentation package names without the `@opentelemetry/instrumentation-` prefix.
303+
```
291304
292305
#### Learn more {#js-learn-more}
293306

0 commit comments

Comments
 (0)