Skip to content

feat(core)!: remove deprecated getTimeOrigin, otperformance, _globalThis, unrefTimer - #7053

Merged
pichlermarc merged 2 commits into
open-telemetry:mainfrom
aryamohanan:feat/remove-deprecated-core
Sep 3, 2026
Merged

pichlermarc merged 2 commits into
open-telemetry:mainfrom
aryamohanan:feat/remove-deprecated-core

Conversation

@aryamohanan

@aryamohanan aryamohanan commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Which problem is this PR solving?

This PR removes deprecated types and functions from @opentelemetry/core as part of the SDK 3.x cleanup.

ref #7052

Short description of the changes

Removed the following deprecated symbols:

  • getTimeOrigin() → use performance.timeOrigin directly
  • otperformance → use the global performance object directly
  • _globalThis → use globalThis directly
  • unrefTimer() → call timer.unref() directly

Updated consumers within the repository to use the replacements.

Also added migration guidance for the removed APIs to doc/3.x/migration-guide.md and linked it from the changelog.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Ran the relevant @opentelemetry/core tests and the affected package tests.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added/updated
  • Documentation has been updated

@aryamohanan
aryamohanan requested review from a team as code owners September 2, 2026 18:23
@codecov

codecov Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.99%. Comparing base (52a9a57) to head (b689de5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7053      +/-   ##
==========================================
- Coverage   94.99%   94.99%   -0.01%     
==========================================
  Files         409      407       -2     
  Lines       14338    14331       -7     
  Branches     3280     3279       -1     
==========================================
- Hits        13621    13614       -7     
  Misses        717      717              
Files with missing lines Coverage Δ
...emetry-instrumentation-xml-http-request/src/xhr.ts 93.22% <100.00%> (ø)
packages/opentelemetry-core/src/common/time.ts 96.96% <ø> (-0.14%) ⬇️
packages/sdk-trace/src/Span.ts 97.51% <100.00%> (ø)
🚀 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.

Comment thread doc/3.x/migration-guide.md Outdated

// after
const timer = setTimeout(() => {}, 1000);
timer.unref();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this example could break in browser or shared code, since browser timers are numbers and don’t have .unref(). Could we keep the typeof timer !== 'number' check here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, thanks! I’ll keep the typeof timer !== 'number' check to support browser/shared code.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-09-03 08:21 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@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.

thank you!

@pichlermarc
pichlermarc added this pull request to the merge queue Sep 3, 2026
Merged via the queue into open-telemetry:main with commit 0d3b359 Sep 3, 2026
30 checks passed
@otelbot-js otelbot-js Bot mentioned this pull request Sep 4, 2026
trentm pushed a commit to open-telemetry/opentelemetry-js-contrib that referenced this pull request Sep 25, 2026
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.

3 participants