Skip to content

🐛 Fix action <-> long task correlation#4033

Merged
amortemousque merged 2 commits intomainfrom
aymeric/fix-long-task-action-link
Dec 16, 2025
Merged

🐛 Fix action <-> long task correlation#4033
amortemousque merged 2 commits intomainfrom
aymeric/fix-long-task-action-link

Conversation

@amortemousque
Copy link
Collaborator

@amortemousque amortemousque commented Dec 15, 2025

Motivation

When a click handler runs longer than 50 ms, it creates a long task. Before this fix, the RUM long task was not linked to the RUM action because the action used clocksNow() instead of event.timeStamp. As a result, long_task.startTime was earlier than action.startTime. After the fix, long_task.startTime is later than action.startTime, which allows proper
correlation.

Increase by 6× the number of long tasks correlated with a click in the Datadog UI.
Query: @long_task.scripts.invoker:click @action.id:*
image

Changes

  • Use startEvent.timeStamp for the RUM action startTime

Test instructions

Checklist

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

@amortemousque amortemousque requested a review from a team as a code owner December 15, 2025 09:44
@amortemousque amortemousque force-pushed the aymeric/fix-long-task-action-link branch from 562f191 to 659f9f8 Compare December 15, 2025 09:45
@cit-pr-commenter
Copy link

cit-pr-commenter bot commented Dec 15, 2025

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 164.33 KiB 164.34 KiB +11 B +0.01%
Rum Profiler 4.32 KiB 4.32 KiB 0 B 0.00%
Rum Recorder 19.74 KiB 19.74 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.61 KiB 121.62 KiB +11 B +0.01%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance

Pending...

🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 26.34 KiB 25.93 KiB -418 B
RUM - add action 48.80 KiB 48.60 KiB -211 B
RUM - add timing 24.90 KiB 24.47 KiB -438 B
RUM - add error 54.02 KiB 54.24 KiB +219 B
RUM - start/stop session replay recording 23.71 KiB 24.50 KiB +815 B
RUM - start view 425.08 KiB 423.29 KiB -1.79 KiB
Logs - log message 43.26 KiB 43.86 KiB +617 B

🔗 RealWorld

@datadog-official
Copy link

datadog-official bot commented Dec 15, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 100.00%
Overall Coverage: 92.68% (+0.01%)

View detailed report

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

Copy link
Collaborator

@thomasbertet thomasbertet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So nice to see the correlation improvement! Code changes LGTM!

@amortemousque amortemousque merged commit 4726dad into main Dec 16, 2025
21 checks passed
@amortemousque amortemousque deleted the aymeric/fix-long-task-action-link branch December 16, 2025 08:58
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants