Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support undici #622

Open
tenjaa opened this issue Oct 22, 2023 · 1 comment
Open

Support undici #622

tenjaa opened this issue Oct 22, 2023 · 1 comment

Comments

@tenjaa
Copy link

tenjaa commented Oct 22, 2023

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)"
    ]
}

@wangzlei
Copy link
Contributor

wangzlei commented Dec 4, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants