enhanced-adot-node-autoinstrumentation
Version:
This package provides Amazon Web Services distribution of the OpenTelemetry Node Instrumentation, which allows for auto-instrumentation of NodeJS applications.
40 lines (30 loc) • 1.82 kB
Markdown
# AWS Distro for OpenTelemetry (ADOT) NodeJS Auto-Instrumentation
Install this package into your NodeJS project with:
```shell
npm install --save enhanced-adot-node-autoinstrumentation
```
Run your application with ADOT NodeJS with:
```shell
node --require 'enhanced-adot-node-autoinstrumentation/register' your-application.js
```
## Sample Environment Variables for Application Signals
```shell
export OTEL_RESOURCE_ATTRIBUTES=service.name=example-application-service-name
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true
export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces
export OTEL_TRACES_EXPORTER=console,otlp
export OTEL_TRACES_SAMPLER=xray
export OTEL_TRACES_SAMPLER_ARG=endpoint=http://localhost:2000,polling_interval=300
export OTEL_METRICS_EXPORTER=awsemf
export OTEL_EXPORTER_OTLP_LOGS_HEADERS=x-aws-log-group=/testemflogexporter/group1,x-aws-log-stream=TEST_LOG_STREAM_NAME_03,x-aws-metric-namespace=TEST_EMF_03
export OTEL_METRIC_EXPORT_INTERVAL=10000
```
### General Recommendations
| Environment Variable | Description | Example |
| -------------------- | ----------- | ------- |
| `OTEL_EXPORTER_OTLP_PROTOCOL` | Leave unset so that ADOT JS will use a recommended OTLP protocol | `http/protobuf` |
| `OTEL_PROPAGATORS` | Leave unset so that ADOT JS will use a recommended list of propagators | `xray,tracecontext,b3,b3multi` |
| `OTEL_NODE_DISABLED_INSTRUMENTATIONS` | Leave unset so that ADOT JS will disable a recommended list of instrumentations | `fs,dns` |
| `OTEL_NODE_RESOURCE_DETECTORS` | Leave unset so that ADOT JS will use a recommended list of Resource Detectors. If set, `env` should be at the end of the list | `aws,env` |