-
Notifications
You must be signed in to change notification settings - Fork 534
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
refactor: migrate mongodb to instrumentation #250 #354
Conversation
Codecov Report
@@ Coverage Diff @@
## main #354 +/- ##
=======================================
Coverage 93.88% 93.88%
=======================================
Files 12 12
Lines 409 409
Branches 44 44
=======================================
Hits 384 384
Misses 25 25 |
plugins/node/opentelemetry-instrumentation-mongodb/package.json
Outdated
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-mongodb/package.json
Outdated
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-mongodb/src/mongodb.ts
Outdated
Show resolved
Hide resolved
7d63e90
to
6d7367b
Compare
About |
6d7367b
to
9c99321
Compare
Can you paste the output of the broken test? |
You can see the tests output here: https://github.com/open-telemetry/opentelemetry-js-contrib/runs/1977512692?check_suite_focus=true |
plugins/node/opentelemetry-instrumentation-mongodb/src/mongodb.ts
Outdated
Show resolved
Hide resolved
undefined, | ||
[ | ||
new InstrumentationNodeModuleFile<WireProtocolInternal>( | ||
'mongodb/lib/core/wireprotocol/index.js', |
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 doesn't work on windows because of the /
. Using \\
works (but most likely breaks non windows).
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.
Have you tested this on windows? I think this uses the node module resolver which I thought normalized paths.
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.
Even though i think its handled by node, if thats an actual bug we should fix this directly in the instrumentation base package because the mongodb plugin isn't the only one to use internals require
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.
Yes, tested on windows.
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.
@Flarna Could you open an issue on the main repo with the details ? we should fix this before RC of SDK for sure
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.
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.
What about using path.normalize('mongodb/lib/core/wireprotocol/index.js'),
for now? The turnaround time for a fix in core until it arrives in contrib is not that short.
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.
I'm fine doing that in another PR so we can do one PR for all contrib, WDYT ?
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.
I think we should make a fix in core repo when InstrumentationNodeModuleFile
is being created use path.normalize as @Flarna mentioned
Can you document in the readme and in the package.json that this package is mac/linux only for now until the instrumentation package is updated? |
I think it would be better to make a dedicated PR for that, the graphql and grpc instrumentation use internal require for sure and i'm not sure about others. WDYT ? |
56adc2d
to
a5187a0
Compare
I can confirm that grpc instrumenation tests fail on windows because of the slashes issue. |
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.
generally looks fine, I have just one concern with dropping support for older version we did support with plugin
Please don't merge the PR as i need to bump api dependency to 0.18 |
1a6c1d4
to
b381381
Compare
I migrated the plugin to instrumentation class, however i also updated the patch to hook to different files (which are more up to date with latest version and more precise).
It support
mongodb
starting3.3
which was released in the summer of 2019. I though adding back support for< 3.3
but i think it make more sense in a seperate PR + see if supporting those old versions is actually needed.