✨ [RUM-16632] add profiling bridge mode support#4747
Conversation
Bundles Sizes Evolution
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 1afb4bc | 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". |
| } | ||
|
|
||
| export interface ProfilingPayload { | ||
| profile: BrowserProfileEvent |
There was a problem hiding this comment.
suggestion: call this property event to align the naming between transports?
There was a problem hiding this comment.
The bridge "event" is actually the full payload:
{
"eventType": "profile",
"event": {
"profile": { ...BrowserProfileEvent },
"trace": { ...BrowserProfilerTrace }
}
}There was a problem hiding this comment.
So, you do this to avoid the `event: { event: ... }?
I would still rename profile to event in the payload to avoid back-and-forth between namings:
But that's a nitpick, you can ignore :)
There was a problem hiding this comment.
So, you do this to avoid the `event: { event: ... }?
Yeah, it felt a bit confusing
- 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".
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