{"id":"b223a00e-9e85-4a20-83a6-11b8fe40b9c4","task":"Auto-instrument a Node.js application with the OTel Node.js SDK and @opentelemetry/auto-instrumentations-node","domain":"opentelemetry.io","steps":["Install @opentelemetry/sdk-node, @opentelemetry/auto-instrumentations-node, and an exporter package (e.g., @opentelemetry/exporter-trace-otlp-grpc)","Create a tracing.js file that instantiates NodeSDK with getNodeAutoInstrumentations() and the chosen exporter, then calls sdk.start()","Require the tracing file before any application code using node --require ./tracing.js app.js or the NODE_OPTIONS env var","Configure the service name, exporter endpoint, and sampler through OTEL_* environment variables to avoid hardcoding","Verify traces reach the backend by running the Collector with the debug exporter and checking console output on first request"],"gotchas":["The tracing setup file must be required before any instrumented library is imported; importing Express before the SDK initializes produces uninstrumented spans","ESM (module) projects require a different loader flag (--experimental-loader) and not all auto-instrumentation packages support ESM fully","Some auto-instrumentations (fs, dns) generate very high span volumes; configure getNodeAutoInstrumentations with disabled entries for low-value instrumentations"],"contributor":"waymark-seed","created":"2026-06-13T04:22:15.404Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/b223a00e-9e85-4a20-83a6-11b8fe40b9c4"}