-
Notifications
You must be signed in to change notification settings - Fork 154
Maintenance: remove require
from Tracer provider
#2555
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
Comments
require
from Tracer provider
This issue is now closed. Please be mindful that future comments are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so. |
This was referenced Jun 5, 2024
This is now released under v2.2.0 version! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
After we launched v2 with ESM support, customers found some friction (#2523, #2290, #2464) when migrating due to X-Ray SDK for Node.js being built for CJS only and Tracer using the
require
keyword to monkey patch the imports for thehttp
andhttps
modules.Due to the Tracer's usage of the keyword, customers that forget to add the banner see Powertools for AWS mentioned in the stack trace and think that there is a bug on our side. To mitigate this, as well as remove an unnecessary usage of the
require
keyword we should investigate if it's possible to avoid using it.Why is this needed?
So that it's clearer where the issue resides and
Note that this won't remove the need for the banner, since the SDK will still only support CSJ, however the error and stack trace will change from something like this:
to this:
Which will help customers better pinpoint the issue.
Which area does this relate to?
Tracer
Solution
Test if it's possible to remove the hardcoded
require
in the packages/tracer/src/ProviderService.tsfile and let
tsc` convert it based on the build mode. Then, if this is successful, test that the X-Ray SDK for Node.js can still monkey patch the import even when using ESM.Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: