What version of OpenTelemetry are you using?
- @opentelemetry/auto-instrumentations-node: 0.77.0
- @opentelemetry/instrumentation-openai: 0.17.0
What version of Node are you using?
What did you do?
Try to use instrumentation with a JSON structured output.
What did you expect to see?
Success
What did you see instead?
Instrumentation throws an error and parsing fails.
Run failed: TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:6961:31)
at _Response.json (node:internal/deps/undici/undici:6912:18)
at /home/hien/slim_dev/parse-error/node_modules/openai/internal/parse.js:36:41
at APIPromise.defaultParseResponse [as parseResponse] (/home/hien/slim_dev/parse-error/node_modules/openai/internal/parse.js:41:7)
at APIPromise.parseResponse (/home/hien/slim_dev/parse-error/node_modules/openai/core/api-promise.js:26:188)
at /home/hien/slim_dev/parse-error/node_modules/openai/core/api-promise.js:60:75
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async runParse (/home/hien/slim_dev/parse-error/main.cjs:13:3)
at async main (/home/hien/slim_dev/parse-error/main.cjs:44:3)
Additional context
Test case attached, example usage:
OPENAI_API_KEY=... npm run no-otel
OPENAI_API_KEY=... npm run otel
parse-error-repro.tar.gz
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
What version of OpenTelemetry are you using?
What version of Node are you using?
What did you do?
Try to use instrumentation with a JSON structured output.
What did you expect to see?
Success
What did you see instead?
Instrumentation throws an error and parsing fails.
Additional context
Test case attached, example usage:
parse-error-repro.tar.gz
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.