✨ [RUM-16632] add profiling bridge mode support#4747
Conversation
Bundles Sizes Evolution
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 0b00e97 | Docs | Datadog PR Page | Give us feedback! |
7823bb8 to
7bbd8e9
Compare
7bbd8e9 to
d0e4767
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
- remove createBridgeEmitter/createFormDataEmitter imports from profilerApi.ts (main bundle) - createRumProfiler now calls canUseEventBridge() directly to select transport - add transport selection tests in datadogProfiler.spec.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1afb4bc37b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21e7e74a8a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
In bridge mode the initial startup path now skips the browser profilingSampleRate because the native SDK owns sampling, but this renewal path still applies the web session sampling check. When a bridged profile is started by the native side despite profilingSampleRate: 0 or another browser-side sample-out, a later SESSION_EXPIRED/SESSION_RENEWED cycle returns here and profiling never resumes until reload even though the bridge still advertises PROFILES; this should use the same bridge-aware sampling decision as startup.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- add `capabilities` option to `EventBridgeOptions` (defaults to `['records']`) - only the profiling bridge test opts into `['profiles']` capability - prevents profiler from starting in unrelated bridge tests
@chatgpt-codex-connector that is indeed a known issue with the bridge, session expiration / renewal is not propagated from native SDK to browser SDK. |
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
BridgeCapability.PROFILES: route profiling through the bridge when the native SDK advertises it, disable profiling silently when a bridge is present without that capabilityemitPayloadcallback so the profiler core no longer owns transport decisionsProfilingPayloadas a shared domain type (profile+trace) passed to both the bridge emitter and the FormData emitterformDataEmitter, 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