-
Notifications
You must be signed in to change notification settings - Fork 743
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
Incompatibility with npm modules which need a fresh copy of submodules #3655
Comments
This seems to be caused by the fact that If this is a bug, then the root cause is with |
I think it's not needed to use something which doesn't cache. If someone modifies/bypasses node cache like stealthy-require the hook would be called again and this second instance would be also instrumented. Another option is to patch stealthy-require to remove the module in question not only in node cache but also in require-in-the-middle. But that seems quite a hacky aproach. But well, that fits maybe well into the world of monkey patching and module cache modifcation :o). |
I have added a code change suggestion to the require-in-the-middle bug report. The maintainer hasn't reacted to the report at all yet. To workaround this problem for now: Would you accept a pull request to pass in an option to only hook into certain instrumentations via require-in-the-middle?
That would be great. Thanks |
@dyladan I would like to create a PR |
@kirrg001 There is no need to ask for permissions to create a PR :o) |
refs open-telemetry#3655 - process.env.OTEL_REQUIRE_ONLY
refs open-telemetry#3655 - process.env.OTEL_REQUIRE_ONLY
@Flarna I've never asked for permission. I have asked for a pre-approval of the suggested change. |
refs open-telemetry#3655 - process.env.OTEL_REQUIRE_ONLY for b2b usages
refs open-telemetry#3655 - added process.env.OTEL_REQUIRE_ONLY for e.g. b2b usages - useful when you only want to use specific otel instrumentations
I'm labeling this as an enhancement since it is a workaround for a bug in one of our dependencies. I also linked the PR so that people finding this issue will be directed there. |
I've created a PR to fix this: elastic/require-in-the-middle#63 (My change removes the |
This includes a RITM feature to allow reloading (and re-run of the RITM hook) of non-core modules when deleting them from 'require.cache'. Fixes: open-telemetry#3655
What happened?
Steps to Reproduce
See elastic/require-in-the-middle#61.
There is also a zip inside.
Expected Result
I expected no error.
Opentelemetry is not compatible with npm modules, which rely on a fresh copy of submodules.
See https://github.com/request/request-promise-native/blob/master/lib/rp.js#L7
See https://github.com/request/request-promise/blob/master/lib/rp.js#L10
Actual Result
Error
Additional Details
OpenTelemetry Setup Code
package.json
Relevant log output
No response
The text was updated successfully, but these errors were encountered: