-
Notifications
You must be signed in to change notification settings - Fork 821
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
fix: Replace require with import #4015
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done intentionally. The util is lazy loaded after application start because it requires the http module. If we require the http module, we then can't instrument it later. I believe we should be able to now for traces because of the proxy tracer which has been added to address this issue, but there still is no solution for that in metrics or logs. @pichlermarc you're more familiar with the exporters than me. Am I missing anything here?
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4015 +/- ##
==========================================
+ Coverage 92.30% 92.31% +0.01%
==========================================
Files 321 321
Lines 9189 9189
Branches 1953 1953
==========================================
+ Hits 8482 8483 +1
+ Misses 707 706 -1 |
The Not sure about the plans to publish an ESM module but if this is planned I guess this should be likely a dynamic import or so. But not sure if ESM and CJS can be in a single file for such cases. |
exactly this. What it is trying to do is to defer requiring anything before instrumentations can wrap it, so the ProxyTracerProvider does not help in this case, unfortunately.
Yep, I think we'll need to take care of this using multiple files. ESM publishing was already added in #3208 if I recall correctly. |
Bah yeah sorry.
Our ESM publishing only works for bundlers which find the |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This PR was closed because it has been stale for 14 days with no activity. |
Which problem is this PR solving?
Modernise by replacing
require
withimport
.This may also solve the following error when running tests that execute instrumented code
that has at least one exporter configured:
Short description of the changes
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: