-
Notifications
You must be signed in to change notification settings - Fork 46
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
prevent require() patching #16
Comments
@bpasero We set |
@ramya-rao-a we should consider an alternative solution that does not patch our |
Logged upstream issue microsoft/ApplicationInsights-node.js#425 |
@bpasero Turns out there is a workaround we can apply that will prevent the monkey patching of the require module. The workaround is to update one of the global properties before calling appinsights. See microsoft/ApplicationInsights-node.js#425 (comment) But, there are third party extensions that use the ApplicationInsights module directly and so will end up monkey patching the require module anyway. And so, I don't see a way to escape the patching for the extension host. https://github.com/Microsoft/node-diagnostic-channel/blob/master/src/diagnostic-channel/src/channel.ts#L128-L137 is the exact place where the monkey patching takes place for When we upgrade app insights module for VS Code core, we will have to use the same workaround. |
@ramya-rao-a not sure I follow, if we do microsoft/ApplicationInsights-node.js#425 (comment) how can "third party extensions use the ApplicationInsights module directly" and get the old behaviour? |
Oops, my mistake. I somehow assumed the workaround had to be taken by every extension that uses the application insights module (with or without vscode-extension-telemetry). That of course is not the case. I can add the workaround to The only catch is that if there are 3rd party extensions using the diagnostic-channel, then that feature would break. |
@ramya-rao-a yeah I think thats fine. If you set this very early in the module I think we are good. Thanks. |
On second thoughts, this might cause such 3rd party extensions to crash/misbehave or best case scenario fail gracefully
|
The latest version of |
By using
APPLICATION_INSIGHTS_NO_PATCH_MODULES
via #12 (comment)
The text was updated successfully, but these errors were encountered: