Visitar URL original
refactor(tracing): move setup to sdk-trace by adityareddy-dev · Pull Request #2358 · grafana/faro-web-sdk · GitHub
Skip to content

refactor(tracing): move setup to sdk-trace - #2358

Open
adityareddy-dev wants to merge 3 commits into
grafana:mainfrom
adityareddy-dev:refactor/tracing-sdk-trace
Open

adityareddy-dev wants to merge 3 commits into
grafana:mainfrom
adityareddy-dev:refactor/tracing-sdk-trace

Conversation

@adityareddy-dev

@adityareddy-dev adityareddy-dev commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Why

SDK 3.x drops @opentelemetry/sdk-trace-web and @opentelemetry/sdk-trace-base. @opentelemetry/sdk-trace 2.12 already has everything web-tracing uses, so this can go in on 2.x and nothing changes for users.

What

Web tracing uses TracerProvider from @opentelemetry/sdk-trace and registers the global tracer provider, propagator and context manager itself instead of calling provider.register(). Batch settings stay at 1000 ms and 30.

Removed the unused @opentelemetry/exporter-trace-otlp-http dependency and held @opentelemetry/sdk-trace below 3.0 in Renovate. The custom tracing setup in the quick start is updated too.

#1845 touches the same code, so whichever lands second needs a rebase.

Links

Closes #2337
Part of #2341

Checklist

  • Tests added
  • Changelog updated
  • Documentation updated

Copilot AI lite review requested due to automatic review settings November 2, 2026 20:41
@adityareddy-dev
adityareddy-dev requested a review from a team as a code owner November 2, 2026 20:41

Copilot AI left a comment

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.

🟡 Changes recommended

The change leaves the documented custom-tracing example dependent on a removed package, so users following the installation instructions can encounter unresolved imports and incompatible APIs.

1 open issue
What changed in this PR

This pull request migrates Faro web tracing from @opentelemetry/sdk-trace-web to @opentelemetry/sdk-trace, preparing the package for OpenTelemetry SDK 3.x while preserving existing tracing behavior.

Changes:

  • Replaces WebTracerProvider with TracerProvider and makes provider, propagator, and context-manager registration explicit.
  • Updates tracing types, samplers, exporters, span processors, batch processor options, and related tests.
  • Removes unused dependencies and updates the lockfile and Renovate constraints.
  • The documented custom-tracing setup should also be updated to reflect the removed sdk-trace-web dependency and replacement APIs.
File Description
yarn.lock Updates resolved OpenTelemetry dependencies and removes obsolete tracing packages.
packages/​web-tracing/​src/​types.ts Sources span processor types from sdk-trace.
packages/​web-tracing/​src/​sampler.ts Imports sampling decisions from sdk-trace.
packages/​web-tracing/​src/​sampler.test.ts Updates sampler test imports.
packages/​web-tracing/​src/​instrumentation.ts Uses TracerProvider, the new batch processor options, and explicit global registration.
packages/​web-tracing/​src/​instrumentation.test.ts Covers provider, propagator, context-manager registration, and single-owner behavior.
packages/​web-tracing/​src/​instrumentation.prerender.test.ts Updates ReadableSpan type imports.
packages/​web-tracing/​src/​faroUserActionSpanProcessor.ts Uses span processor types from sdk-trace.
packages/​web-tracing/​src/​faroTraceExporter.ts Uses exporter and readable-span types from sdk-trace.
packages/​web-tracing/​src/​faroMetaAttributesSpanProcessor.ts Uses span processor types from sdk-trace.
packages/​web-tracing/​package.json Replaces sdk-trace-web with sdk-trace and removes the unused OTLP HTTP exporter; related custom-tracing documentation needs updating.
.github/​renovate.json Holds sdk-trace below version 3 until the broader migration.

Review effort: Lite

Comment thread packages/web-tracing/package.json Resolved
Copilot AI lite review requested due to automatic review settings November 2, 2026 21:17
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Signed commits report

All 3 commits between main and refactor/tracing-sdk-trace have verified signatures. ✅

Copilot AI left a comment

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.

🟡 Changes recommended

The quick-start documentation still specifies an API version range that can resolve an incompatible dependency and cause peer-resolution failures, so the active moderate finding requires correction.

2 open issues

Review effort: Lite

@adityareddy-dev
adityareddy-dev force-pushed the refactor/tracing-sdk-trace branch from 1eb419f to 806120e Compare November 2, 2026 22:13
Copilot AI lite review requested due to automatic review settings November 2, 2026 22:13

Copilot AI left a comment

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.

🔵 Needs a closer look

Global OTel provider, propagator, and context-manager registration changes are covered by mocked APIs, so the built package and browser behavior with sdk-trace 2.12 still require human verification.

No open issues 🎉

2 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings November 5, 2026 19:22

Copilot AI left a comment

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.

🟢 Approval recommended

The migration updates the tracing implementation, dependencies, and documentation while adding registration-path coverage, with no active review issues remaining.

No open issues 🎉

Review effort: Lite

@adityareddy-dev

Copy link
Copy Markdown
Contributor Author

@Blinkuu could you review this one? #2363 and #2364 build on it, so it goes first.

@Blinkuu

Blinkuu commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Hey @martinkuba 👋 Could you please take a look at this?

@Blinkuu
Blinkuu requested a review from martinkuba November 13, 2026 11:06

This branch has not been deployed

No deployments
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.

Move tracing setup to @opentelemetry/sdk-trace

3 participants