Skip to content

Conversation

@rgaignault
Copy link
Contributor

@rgaignault rgaignault commented Dec 18, 2025

Motivation

Clicks inside Shadow DOM components currently result in imprecise action names because event.target is retargeted to the shadow host.

Changes

This PR adds experimental support for extracting accurate action names from elements inside Shadow DOM

  • betaTrackActionsInShadowDom Enables action name extraction from Shadow DOM elements
  • Uses event.composedPath() to get the actual clicked element

This is the first phase of Shadow DOM support, focusing on action names only. Selector tracking inside Shadow DOM will be added in a follow-up PR. This feature is experimental and gated behind the betaTrackActionsInShadowDom opt-in parameter.

Test instructions

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@rgaignault rgaignault requested a review from a team as a code owner December 18, 2025 13:45
@rgaignault rgaignault marked this pull request as draft December 18, 2025 13:54
@rgaignault rgaignault marked this pull request as ready for review December 18, 2025 14:45
@cit-pr-commenter
Copy link

cit-pr-commenter bot commented Jan 7, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 164.34 KiB 164.90 KiB +573 B +0.34%
Rum Profiler 4.32 KiB 4.32 KiB 0 B 0.00%
Rum Recorder 20.03 KiB 20.03 KiB 0 B 0.00%
Logs 56.14 KiB 56.14 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 121.62 KiB 122.21 KiB +600 B +0.48%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0046 0.0054 +17.39%
RUM - add action 0.0132 0.0144 +9.09%
RUM - add error 0.0145 0.0123 -15.17%
RUM - add timing 0.0028 0.0031 +10.71%
RUM - start view 0.0035 0.0035 0.00%
RUM - start/stop session replay recording 0.0007 0.0007 0.00%
Logs - log message 0.0147 0.015 +2.04%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 25.63 KiB 26.07 KiB +448 B
RUM - add action 49.22 KiB 48.79 KiB -442 B
RUM - add timing 23.95 KiB 24.47 KiB +527 B
RUM - add error 55.41 KiB 55.13 KiB -291 B
RUM - start/stop session replay recording 23.60 KiB 24.22 KiB +629 B
RUM - start view 423.90 KiB 424.00 KiB +93 B
Logs - log message 44.35 KiB 44.47 KiB +128 B

🔗 RealWorld

@datadog-official
Copy link

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 80.65%
Overall Coverage: 77.23% (-0.00%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 59e2225 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

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.

2 participants