Skip to content

🐛 [RUMS-6286] avoid fallback trace sampling in WebViews - #5008

Draft
amortemousque wants to merge 1 commit into
mainfrom
aymeric/sync-trace-sampling-bridge
Draft

🐛 [RUMS-6286] avoid fallback trace sampling in WebViews#5008
amortemousque wants to merge 1 commit into
mainfrom
aymeric/sync-trace-sampling-bridge

Conversation

@amortemousque

@amortemousque amortemousque commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Motivation

In WebViews, the native SDK owns the trace sampling decision. When that decision is temporarily unavailable, the Browser SDK currently falls back to its own sampling decision. The two decisions can differ and produce inconsistent tracing for the same mobile session.

This addresses RUMS-6286.

Changes

  • Treat a missing native trace sampling decision as not sampled when the event bridge is active.
  • Keep the Browser SDK sampling decision for non-WebView usage.
  • Add unit coverage for XHR and Fetch requests.
  • Add E2E coverage for an event bridge without a native sampling decision.

The implementation and tests were prepared with Codex.

Test instructions

  • yarn test:unit --spec packages/browser-rum-core/src/domain/tracing/tracer.spec.ts — 43 tests passed.
  • ESLint passed on the three changed files.
  • Prettier passed on the three changed files.
  • TypeScript passed for the changed tracing files and the E2E project.
  • The focused E2E run could not start locally because the Next.js test-app dependency is not installed (next: command not found).

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 3, 2026

Copy link
Copy Markdown

Tests

All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.02% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e14d52e | Docs | View more details | Give us feedback!

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 181.76 KiB 181.76 KiB -3 B -0.00%
Rum Profiler 8.43 KiB 8.43 KiB 0 B 0.00%
Rum Recorder 25.32 KiB 25.32 KiB 0 B 0.00%
Logs 57.93 KiB 57.93 KiB 0 B 0.00%
Rum Salesforce N/A 139.82 KiB N/A N/A N/A
Rum Slim 139.81 KiB 139.81 KiB -3 B -0.00%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%
Rum Shopify N/A 206.12 KiB N/A N/A N/A
Rum-shopify Profiler N/A 8.43 KiB N/A N/A N/A
Rum-shopify Recorder N/A 3.74 KiB N/A N/A N/A

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.

1 participant