This guide covers Node.js applications running on ECS, EC2, Kubernetes, or any container/VM environment. For AWS Lambda, see the Node.js Lambda guide.
1. Install the OpenTelemetry SDK
2. Enable Auto Instrumentation
Enable auto instrumentation by requiring theauto-instrumentations-node module using the --require flag:
3. Set Environment Variables
Add these environment variables to your service. ReplaceYOUR_TRACE0_ENV_API_KEY with the API key from your Trace0 environment.
| Variable | Value |
|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT | https://app.trace0hq.com/api |
OTEL_EXPORTER_OTLP_HEADERS | X-API-KEY=YOUR_TRACE0_ENV_API_KEY |
OTEL_EXPORTER_OTLP_PROTOCOL | http/protobuf |