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

fix(next, redis, mongodb): ensure module sub-path RITM hooks are applied on Windows #3905

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

trentm
Copy link
Member

@trentm trentm commented Mar 8, 2024

For some instrumentations we path module sub-paths (e.g. mongodb/lib/foo.js).
On Windows RITM returns modPath=mongodb\lib\foo.js. This change adds path
separator normalization so those values equate. Before this the module
patcher for that subpath was not applied.


This impacts instrumentation for Next.js, redis v4+, and part of the instrumentation for mongodb.
The reason this wasn't caught in testing is because:

  • for other reasons testing Next.js on Windows is a limitation (process control things, see comments in the test file)
  • redis and mongodb (among other) instrumentations are not tested on Windows because GH actions does not support "services" on Windows runners

…ied on Windows

For some instrumentations we path module sub-paths (e.g. mongodb/lib/foo.js).
On Windows RITM returns modPath=mongodb\lib\foo.js. This change adds path
separator normalization so those values equate. Before this the module
patcher for that subpath was not applied.
@trentm trentm requested a review from david-luna March 8, 2024 23:39
@trentm trentm self-assigned this Mar 8, 2024
@trentm trentm merged commit 8374a42 into main Mar 12, 2024
18 checks passed
@trentm trentm deleted the trentm/fix-ritm-windows-path-norm branch March 12, 2024 14:44
fpm-peter pushed a commit to fpm-git/apm-agent-nodejs that referenced this pull request Aug 20, 2024
…ied on Windows (elastic#3905)

For some instrumentations we path module sub-paths (e.g. mongodb/lib/foo.js).
On Windows RITM returns modPath=mongodb\lib\foo.js. This change adds path
separator normalization so those values equate. Before this the module
patcher for that subpath was not applied.
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

Successfully merging this pull request may close these issues.

2 participants