Skip to content

Conversation

@HugoGarrido
Copy link
Collaborator

Motivation

LCP Subparts are values that compute the final LCP measure the browser SDK.

This is helpful for troubleshooting LCP since it help to define what type of LCP issue we are facing (server, render etc.) by looking at the biggest contributor (more details in this doc)

Here is a breakdown of each part :

Subpart Meaning
TTFB Already tracked by the Browser SDK as firstByte
Resource load delay Time between firstByte and the loading start of the resource associated with the LCP. 0 if no resource are attached to the LCP
Resource load duration Time to takes to load the resource attached to the LCP0 if no resource are attached to the LCP
Element render delay Time between the LCP resource finishes loading and the LCP element is fully rendered

This PR adds the collection of the LCP subparts when we collect the LCP

Changes

  • In trackLargestContentfulPaint when we have an LCP entry :
    • re-measure the TTFB (keeping the name firstByte)
    • get the performance entry related to the LCP resource if applicable
    • compute an optional subParts object that is added in the final payload
  • Extract a helper to safely compute the firstByte value
  • Extract a helper to safely read performance global
  • Update tests, fixtures and types to support the new subParts object

Test instructions

Checklist

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

@github-actions
Copy link

github-actions bot commented Jan 19, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@cit-pr-commenter-54b7da
Copy link

cit-pr-commenter-54b7da bot commented Jan 20, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 164.36 KiB 164.94 KiB +591 B +0.35%
Rum Profiler 4.33 KiB 4.33 KiB 0 B 0.00%
Rum Recorder 24.27 KiB 24.27 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.57 KiB 122.12 KiB +562 B +0.45%
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.0042 0.0044 +4.76%
RUM - add action 0.0135 0.0145 +7.41%
RUM - add error 0.0131 0.0139 +6.11%
RUM - add timing 0.0029 0.0036 +24.14%
RUM - start view 0.0043 0.0042 -2.33%
RUM - start/stop session replay recording 0.0008 0.0009 +12.50%
Logs - log message 0.0147 0.0217 +47.62%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 26.27 KiB 28.31 KiB +2.04 KiB
RUM - add action 48.61 KiB 49.68 KiB +1.06 KiB
RUM - add timing 24.97 KiB 25.15 KiB +186 B
RUM - add error 54.76 KiB 54.43 KiB -340 B
RUM - start/stop session replay recording 23.95 KiB 24.52 KiB +583 B
RUM - start view 424.85 KiB 424.49 KiB -370 B
Logs - log message 95.72 KiB 44.82 KiB -50.90 KiB

🔗 RealWorld

@datadog-official
Copy link

datadog-official bot commented Jan 20, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 1 Test failed

remote configuration › should resolve an option value from js variable from rum/remoteConfiguration.scenario.ts (Datadog) (Fix with Cursor)
createTest.ts:244:3 should resolve an option value from js variable

[Webkit] › ../lib/framework/createTest.ts:244:3 › remote configuration › should resolve an option value from js variable 

    Error: expect(received).toBe(expected) // Object.is equality

    Expected: "js-version"
    Received: undefined

       at rum/remoteConfiguration.scenario.ts:93
...

ℹ️ Info

❄️ No new flaky tests detected

🎯 Code Coverage
Patch Coverage: 72.73%
Overall Coverage: 77.30% (+0.04%)

View detailed report

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

@HugoGarrido
Copy link
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

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