Skip to content

✨ [RUM-16632] add profiling bridge mode support#4747

Draft
bcaudan wants to merge 3 commits into
mainfrom
bcaudan/profiling-bridge-mode
Draft

✨ [RUM-16632] add profiling bridge mode support#4747
bcaudan wants to merge 3 commits into
mainfrom
bcaudan/profiling-bridge-mode

Conversation

@bcaudan
Copy link
Copy Markdown
Collaborator

@bcaudan bcaudan commented Jun 8, 2026

Motivation

Profiling data is always sent directly to the intake via HTTP. In Electron and WebView environments where the native SDK acts as a proxy through the bridge, profiling requests would use dummy session and application IDs, resulting in rejections at the intake.

Changes

  • Add BridgeCapability.PROFILES: route profiling through the bridge when the native SDK advertises it, disable profiling silently when a bridge is present without that capability
  • Refactor the profiler to be transport-agnostic: introduce an emitPayload callback so the profiler core no longer owns transport decisions
  • Add ProfilingPayload as a shared domain type (profile + trace) passed to both the bridge emitter and the FormData emitter
  • Session injection for the non-bridge path moves to formDataEmitter, keeping the bridge path session-free (the native SDK handles it)

Test instructions

Unit tests cover bridge mode routing, session injection, and sampling. E2E test covers the bridge path end-to-end using the mock bridge.

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

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Jun 8, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 171.79 KiB 172.15 KiB +364 B +0.21%
Rum Profiler 7.88 KiB 7.74 KiB -143 B -1.77%
Rum Recorder 21.21 KiB 21.21 KiB 0 B 0.00%
Logs 54.31 KiB 54.31 KiB 0 B 0.00%
Rum Slim 129.70 KiB 129.70 KiB 0 B 0.00%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%

@datadog-datadog-prod-us1

This comment has been minimized.

@bcaudan bcaudan force-pushed the bcaudan/profiling-bridge-mode branch 3 times, most recently from 7174bc3 to 1cd5e11 Compare June 8, 2026 13:39
@bcaudan bcaudan force-pushed the bcaudan/profiling-bridge-mode branch from 1cd5e11 to 7823bb8 Compare June 8, 2026 14:50
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