Skip to content

refactor: use isWrapped from instrumentation package #2704

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

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented Feb 11, 2025

Which problem is this PR solving?

For @opentelemetry/core@2.0.0 we'll remove isWrapped() since it's duplicated in @opentelemetry/instrumentation. It makes more sense to have it in @opentelemetry/instrumentation since that's actually an instrumentation-related utility function.

Refs open-telemetry/opentelemetry-js#5444

Short description of the changes

Uses isWrapped() from @opentelemetry/instrumentation instead. It is a drop-in replacement as the implementations are identical:

ShimWrapped is also fully compatible:

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.40%. Comparing base (2989b94) to head (9af54bb).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2704   +/-   ##
=======================================
  Coverage   92.40%   92.40%           
=======================================
  Files         171      171           
  Lines        8142     8142           
  Branches     1647     1647           
=======================================
  Hits         7524     7524           
  Misses        618      618           
Files with missing lines Coverage Δ
...lugin-react-load/src/BaseOpenTelemetryComponent.ts 97.04% <100.00%> (ø)

@pichlermarc pichlermarc merged commit 58bc158 into open-telemetry:main Feb 11, 2025
25 checks passed
@trentm
Copy link
Contributor

trentm commented Feb 11, 2025

Hrm, this should have failed npm run lint:deps. It does on main now:

[10:36:37 trentm@peach:~/src/opentelemetry-js-contrib (git:main)]
% npm run lint:deps

> opentelemetry-contrib@0.1.0 lint:deps
> npx --yes knip@5.33.3 --dependencies --production --tags=-knipignore

Unused dependencies (2)
@opentelemetry/otlp-transformer  packages/opentelemetry-test-utils/package.json
@opentelemetry/core              plugins/web/opentelemetry-plugin-react-load/package.json
Unlisted dependencies (1)
@opentelemetry/instrumentation  plugins/web/opentelemetry-plugin-react-load/src/BaseOpenTelemetryComponent.ts

[10:36:46 trentm@peach:~/src/opentelemetry-js-contrib (git:main rv:1)]
% echo $?
1

plugins/web/opentelemetry-plugin-react-load needs to change its dep to be on instrumentation instead of core.

@trentm
Copy link
Contributor

trentm commented Feb 11, 2025

Ah, lint:deps was accidentally removed from linting in #2493

https://github.com/open-telemetry/opentelemetry-js-contrib/pull/2493/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L26-R24

Likely from a merge: that PR and adding lint:deps were both within days of each other.

@trentm
Copy link
Contributor

trentm commented Feb 11, 2025

#2709 added to fix that up.

deejay1 pushed a commit to deejay1/opentelemetry-js-contrib that referenced this pull request Apr 14, 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.

5 participants