Skip to content

chore: move sdk-trace-web utils to web-common - #7058

Open
david-luna wants to merge 8 commits into
open-telemetry:mainfrom
david-luna:chore-move-trace-web-utils
Open

chore: move sdk-trace-web utils to web-common#7058
david-luna wants to merge 8 commits into
open-telemetry:mainfrom
david-luna:chore-move-trace-web-utils

Conversation

@david-luna

@david-luna david-luna commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Which problem is this PR solving?

SDK 3.0 will have a single sdk-trace package. Even in the last JS SIG (2026-09-02) it was mentioned a plan to remove the sdk-trace-* packages.

fetch and XmlHttpRequest share code through @opentelemetry/sdk-trace-web package. The code is a set of utility functions to operate with resource timing entries and Span events. Keeping that dependency means devs will install the deprecated packages even if the migrate to the new major version.

By moving the utils to @opentelemetry/web-common we make the fetch and XmlHttpRequest ready for the new SDK version without breaking compatibility.

Type of change

Please delete options that are not relevant.

  • Refactor (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit tests in the instrumentation packages
  • New Unit tests in web-common package

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added

@david-luna david-luna added pkg:instrumentation-fetch browser Browser-specific additions or benefits labels Sep 3, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 3, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on maintainers · refreshed 2026-09-08 08:43 UTC

Merge when ready.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.79208% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.66%. Comparing base (241d86b) to head (4c17ec7).

Files with missing lines Patch % Lines
.../packages/web-common/src/utils-resource-timings.ts 66.28% 59 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7058      +/-   ##
==========================================
- Coverage   95.00%   94.66%   -0.34%     
==========================================
  Files         407      409       +2     
  Lines       14342    14543     +201     
  Branches     3289     3345      +56     
==========================================
+ Hits        13625    13767     +142     
- Misses        717      776      +59     
Files with missing lines Coverage Δ
...s/opentelemetry-instrumentation-fetch/src/fetch.ts 83.17% <100.00%> (ø)
...s/opentelemetry-instrumentation-fetch/src/utils.ts 89.01% <ø> (ø)
...etry-instrumentation-xml-http-request/src/utils.ts 84.48% <ø> (ø)
...emetry-instrumentation-xml-http-request/src/xhr.ts 93.22% <ø> (ø)
...ges/web-common/src/enums/PerformanceTimingNames.ts 100.00% <100.00%> (ø)
experimental/packages/web-common/src/semconv.ts 100.00% <100.00%> (ø)
.../packages/web-common/src/utils-resource-timings.ts 66.28% <66.28%> (ø)
🚀 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.

@david-luna
david-luna marked this pull request as ready for review September 4, 2026 10:56
@david-luna
david-luna requested review from a team as code owners September 4, 2026 10:56
@david-luna david-luna added this to the SDK 3.0 milestone Sep 7, 2026

@pichlermarc pichlermarc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the simple move from @opentelemetry/sdk-trace-web to @opentelemetry/web-common looks good.

I'm leaving out any comments about the actual code being moved (the utilities have some confusing signatures for historical reasons) - we can improve that in follow-ups if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

browser Browser-specific additions or benefits pkg:instrumentation-fetch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants