-
Notifications
You must be signed in to change notification settings - Fork 365
Description
Tracer Version(s)
5.82
Node.js Version(s)
24.9
Bug Report
When instrumenting with dd-trace 5.82 with LLM Observability enabled, the library can throw an unhandled exception if connectivity to the Datadog agent is lost (or intermittently unavailable). If the exception is not caught by a top-level uncaughtException handler, it crashes the entire Node.js process.
This behavior does not feel appropriate for non-critical telemetry functionality.
Expected behavior
If the agent is unavailable, dd-trace should gracefully degrade by temporarily disabling LLM Observability until the agent becomes available again.
Actual behavior
The process can crash due to an unhandled exception originating from the LLM Observability path when the agent is unreachable.
Additional notes
If this is a desired improvement, I’m happy to submit a PR implementing this change.
Reproduction Code
n/a The agent was temporarily unavailable. See error stack trace below.
Error Logs
/app/node_modules/.pnpm/dd-trace@5.82.0_@openfeature+core@1.9.1_@openfeature+server-sdk@1.18.0_@openfeature+core@1.9.1_/node_modules/dd-trace/packages/dd-trace/src/llmobs/index.js:71
throw new Error(
^
Error: Cannot send LLM Observability data without a running agent or without both a Datadog API key and site.
Ensure these configurations are set before running your application.
at /app/node_modules/.pnpm/dd-trace@5.82.0_@openfeature+core@1.9.1_@openfeature+server-sdk@1.18.0_@openfeature+core@1.9.1_/node_modules/dd-trace/packages/dd-trace/src/llmobs/index.js:71:13
at /app/node_modules/.pnpm/dd-trace@5.82.0_@openfeature+core@1.9.1_@openfeature+server-sdk@1.18.0_@openfeature+core@1.9.1_/node_modules/dd-trace/packages/dd-trace/src/llmobs/writers/util.js:25:7
at /app/node_modules/.pnpm/dd-trace@5.82.0_@openfeature+core@1.9.1_@openfeature+server-sdk@1.18.0_@openfeature+core@1.9.1_/node_modules/dd-trace/packages/dd-trace/src/exporters/common/agent-info-exporter.js:15:14
at ClientRequest.<anonymous> (/app/node_modules/.pnpm/dd-trace@5.82.0_@openfeature+core@1.9.1_@openfeature+server-sdk@1.18.0_@openfeature+core@1.9.1_/node_modules/dd-trace/packages/dd-trace/src/exporters/common/request.js:138:7)
at Object.onceWrapper (node:events:623:26)
at ClientRequest.emit (node:events:508:28)
at req.emit (/app/node_modules/.pnpm/dd-trace@5.82.0_@openfeature+core@1.9.1_@openfeature+server-sdk@1.18.0_@openfeature+core@1.9.1_/node_modules/dd-trace/packages/datadog-instrumentations/src/http/client.js:123:25)
at emitErrorEvent (node:_http_client:108:11)
at Socket.socketErrorListener (node:_http_client:575:5)
at Socket.emit (node:events:508:28)
Node.js v24.11.1
[Wed Jan 28 20:33:41 UTC 2026] pnpm exited 1
[Wed Jan 28 20:33:41 UTC 2026] Exiting with status 1
Tracer Config
DD_ENABLE_APM=true
DD_RUNTIME_METRICS_ENABLED=true
DD_PROFILING_ENABLED=true
DD_LOGS_INJECTION=true
DD_LLMOBS_ENABLED=true
Operating System
alpine 3.23
Bundling
No Bundling