Skip to content

Conversation

@onurtemizkan
Copy link
Member

Related: getsentry/sentry-javascript#13869

Which problem is this PR solving?

  • The current version of the instrumentation creates an instance (and returns it) in order to patch the DataLoader constructor for batchLoadFn. This breaks the usage where the DataLoader class is extended.

Short description of the changes

  • This implementation uses the first argument of the DataLoader constructor (which is batchLoadFn) to patch to avoid creating an instance.

@onurtemizkan onurtemizkan requested a review from a team as a code owner October 23, 2024 17:25
@onurtemizkan onurtemizkan changed the title fix(instrumentation-dataloder): Patch batchLoadFn without creating an instance fix(instrumentation-dataloader): Patch batchLoadFn without creating an instance Oct 23, 2024
@onurtemizkan onurtemizkan force-pushed the dataloader-custom-methods branch from 6110fa8 to acfeb34 Compare October 23, 2024 17:29
@codecov
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.76%. Comparing base (2aef158) to head (6dfc797).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../instrumentation-dataloader/src/instrumentation.ts 92.85% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2498      +/-   ##
==========================================
- Coverage   89.77%   89.76%   -0.01%     
==========================================
  Files         187      187              
  Lines        9147     9149       +2     
  Branches     1884     1885       +1     
==========================================
+ Hits         8212     8213       +1     
- Misses        935      936       +1     
Files with missing lines Coverage Δ
.../instrumentation-dataloader/src/instrumentation.ts 98.70% <92.85%> (-0.65%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@onurtemizkan onurtemizkan force-pushed the dataloader-custom-methods branch from acfeb34 to 60d8499 Compare October 29, 2024 11:52
Copy link
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, just a couple edge cases.

@onurtemizkan
Copy link
Member Author

Hey @trentm, can I get another round of reviews, please?

@onurtemizkan onurtemizkan requested a review from a team April 14, 2025 14:36
@pichlermarc
Copy link
Member

cc @henrinormak (component-owner), please review if you find some time 🙂

Copy link
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for having dropped the ball on re-reviewing this.
LGTM.
I'll try to update and handle the merge conflict.

@trentm trentm merged commit b6d293a into open-telemetry:main Jun 26, 2025
23 checks passed
@dyladan dyladan mentioned this pull request Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants