Repository navigation
✨ [RUM-19007] Attribute automatic click actions with element stacks - #5098
amortemousque wants to merge 7 commits into
Conversation
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: c13ff7b | Docs | View more details | Give us feedback! |
Bundles Sizes Evolution
|
567a2bf to
65086b8
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65086b87d4
ℹ️ 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".
| attachElementStack: (element) => { | ||
| const stack = createHandlingStack('element') | ||
| callMonitored(() => { |
There was a problem hiding this comment.
Record attachElementStack API usage
issue: Whenever a customer calls this new public API, the registration is performed without invoking addTelemetryUsage, so usage telemetry cannot report adoption of attachElementStack while the surrounding public methods report their calls. Add a dedicated static usage feature for this API so these calls are observable.
AGENTS.md reference: AGENTS.md:L120-L123
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
More details
Element stacks are stored per SDK instance and snapshotted at pointerdown, preserving attribution for ongoing actions while keeping stacks out of serialized events. The completed static review found no reportable defects.
🤖 Bits Code Review · Commit 65086b8
Motivation
Automatic click actions do not have an application handling stack identifying their microfrontend. Implement the recommended API from the click action attribution RFC.
Changes
Record static
attach-element-stackAPI usage telemetry. Schema dependency: rum-events-format #456.Add
DD_RUM.attachElementStack(element)to RUM and RUM Slim. Capture the caller's stack at the public API entry point and immediately register it in an instance-ownedWeakMap, including beforeinit(). Registrations survive startup without buffering or retaining detached elements strongly.Snapshot the closest registered target/ancestor stack at pointerdown, crossing shadow roots. Re-registration affects future actions; ongoing actions and rage-click groups retain their initial stack.
Resolve service/version through existing source-code metadata and expose
context.elementStackinbeforeSendfor manual attribution. Keep stacks out of serialized events and preserve shell fallback.Add unit and real build-plugin integration coverage, including registration before initialization, RUM Slim, shell fallback, and manual overrides. Implementation and tests were developed with AI assistance and independently reviewed.
Test instructions
git diff --checkpassed.The new scenarios can be run after building the SDK and test apps:
yarn build yarn build:apps --app microfrontend --app vanilla yarn test:e2e microfrontend.scenario.ts -g 'with element stacks' --project chromium --project firefox --project webkitWebKit's existing unload-triggered intake delivery failure was reproduced with the pre-existing custom-action scenario. Diagnostics confirmed correct automatic attribution and normal periodic delivery. The new WebKit cases await regular intake delivery before navigating; production transport behavior is unchanged.
Local E2E validation used built SDK bundles and a temporary configuration that omits unrelated framework servers and allows validated fixture paths under the hidden
.codexworktree. That configuration is not part of this PR.Checklist