Skip to content

Commit

Permalink
Update OTel JS Autoinstrumentation env var config (#4181)
Browse files Browse the repository at this point in the history
Co-authored-by: opentelemetrybot <[email protected]>
  • Loading branch information
cartermp and opentelemetrybot authored Mar 19, 2024
1 parent 666f583 commit 4b89260
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion content/en/docs/languages/js/automatic/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,23 @@ Alternatively, you can use `export` to set environment variables:

```shell
export OTEL_TRACES_EXPORTER="otlp"
export OTEL_METRICS_EXPORTER="otlp"
export OTEL_EXPORTER_OTLP_ENDPOINT="your-endpoint"
export OTEL_NODE_RESOURCE_DETECTORS="env,host,os"
export OTEL_SERVICE_NAME="your-service-name"
export NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register"
node app.js
```

{{% alert title="Note" color="info" %}}

Currently, only Traces are supported for environment variable configuration. See
the open issues for
[Metrics](https://github.com/open-telemetry/opentelemetry-js/issues/4551) and
[Logs](https://github.com/open-telemetry/opentelemetry-js/issues/4552) to learn
more.

{{% /alert %}}

By default, all SDK [resource detectors](/docs/languages/js/resources/) are
used. You can use the environment variable `OTEL_NODE_RESOURCE_DETECTORS` to
enable only certain detectors, or to completely disable them.
Expand Down
8 changes: 8 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -3519,6 +3519,14 @@
"StatusCode": 200,
"LastSeen": "2024-01-18T20:05:19.47948-05:00"
},
"https://github.com/open-telemetry/opentelemetry-js/issues/4551": {
"StatusCode": 200,
"LastSeen": "2024-03-19T06:37:03.56499722Z"
},
"https://github.com/open-telemetry/opentelemetry-js/issues/4552": {
"StatusCode": 200,
"LastSeen": "2024-03-19T06:37:04.053171348Z"
},
"https://github.com/open-telemetry/opentelemetry-js/releases": {
"StatusCode": 200,
"LastSeen": "2024-01-18T19:37:16.288484-05:00"
Expand Down

0 comments on commit 4b89260

Please sign in to comment.