-
Notifications
You must be signed in to change notification settings - Fork 579
fix: instrumentation of ESM-imported mongoose #2793
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: instrumentation of ESM-imported mongoose #2793
Conversation
plugins/node/instrumentation-mongoose/test/mongoose-common.test.ts
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (75.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2793 +/- ##
==========================================
- Coverage 89.50% 89.48% -0.02%
==========================================
Files 180 180
Lines 8719 8725 +6
Branches 1767 1771 +4
==========================================
+ Hits 7804 7808 +4
- Misses 915 917 +2
🚀 New features to boost your workflow:
|
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 pushed a lint fix - overall the PR looks good, thank you for adding the test. 🙂
We can ignore the codecov complaint about the added lines not being covered (that's happening as the test that does cover is running out-of-process).
Which problem is this PR solving?
Instrumenting mongoose while using ESM was crashing with:
Closes #2792
And contributes to #1942
Short description of the changes
This fixes it by checking the default export and also adds a test, that was failing before the fix: