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: use context API to bind connection checkOut callback #1766

Conversation

david-luna
Copy link
Contributor

Which problem is this PR solving?

  • Previous fix for mongodb instrumentation was using AsynResource.bind API which has different behaviour in different node versions. This leads to the instrumentation breaking mongodb driver for node v14

Short description of the changes

  • make use of context.bind from @opentelemetry/api which is not affected by different node versions and is the recommended way to do it (thanks for the tip @Flarna)

Closes: #1759

@david-luna david-luna requested a review from a team November 2, 2023 14:33
Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Merging #1766 (9c8a57c) into main (b9350d9) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1766      +/-   ##
==========================================
- Coverage   91.47%   91.47%   -0.01%     
==========================================
  Files         143      143              
  Lines        7283     7282       -1     
  Branches     1458     1458              
==========================================
- Hits         6662     6661       -1     
  Misses        621      621              
Files Coverage Δ
...try-instrumentation-mongodb/src/instrumentation.ts 52.85% <0.00%> (-0.15%) ⬇️

@blumamir blumamir merged commit 229b1f7 into open-telemetry:main Nov 7, 2023
12 of 13 checks passed
@dyladan dyladan mentioned this pull request Nov 7, 2023
@david-luna david-luna deleted the dluna/1759-mongodb-instrumentation-context-bind branch November 7, 2023 11:09
jmcdo29 pushed a commit to jmcdo29/opentelemetry-js-contrib that referenced this pull request Nov 13, 2023
…etry#1766)

* fix: use context API to bind connection checkOut callback

* chore: fix lint

---------

Co-authored-by: Amir Blum <[email protected]>
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.

bug: mongodb instrumentation breaks for node v14
4 participants