Support undici
tenjaa opened this issue · comments
Torben commented
Undici is the new official node http client.
When trying xray on a Node-18-Lambda while using undici I get an error.
There is an issue on undicis side (nodejs/undici#2190) about not working with xray.
They refer to use the diagnostics channel.
import {captureHTTPsGlobal} from 'aws-xray-sdk';
import * as http from 'http';
import * as https from 'https';
captureHTTPsGlobal(http);
captureHTTPsGlobal(https);
2023-10-22T11:24:52.170Z undefined ERROR Uncaught Exception {
"errorType": "TypeError",
"errorMessage": "Cannot add property __request, object is not extensible",
"stack": [
"TypeError: Cannot add property __request, object is not extensible",
" at enableCapture (file:///var/task/index.mjs:34012:25)",
" at captureHTTPsGlobal3 (file:///var/task/index.mjs:33900:9)",
" at file:///var/task/index.mjs:35587:44",
" at ModuleJob.run (node:internal/modules/esm/module_job:194:25)"
]
}
Lei Wang commented
undici support is in X-Ray nodejs SDK backlog, but we don't have specific timeline due to resource constrains. Now xray service is able to work with OpenTelemetry, for customers need new libraries support at the moment, we recommend customers onboard opentelemetry
Refer to OpenTelemetry undici support: open-telemetry/opentelemetry-js-contrib#1021