Discrepancy with LCP between DevTools and Performance Observer

83 views
Skip to first unread message

Ishan Anand

unread,
May 24, 2021, 4:59:38 PM5/24/21
to web-vitals-feedback
Hi Google Vitals Team,

This would seem to be a bug but maybe there's something we've missed?

In investigating discrepancies between our RUM data and the official CrUX report we've encountered some sites where the LCP reported by the internal DevTools API does not match the LCP reported by the PerformanceObserver API.

Specifically, on some sites if you use the heads up display built into Chrome it shows different values for LCP than you get from querying Performance Observer in console. We've been able to reproduce this on craigslist: 
Note that not all sites seem to exhibit this behavior but haven't been able to nail down yet what criteria is causing it to happen versus not happen.

Appreciate any advice or insight for why this discrepancy exists. Thanks.

-Ishan



Rick Viscomi

unread,
May 24, 2021, 5:28:49 PM5/24/21
to web-vitals-feedback
(resending because I think I forgot to "Reply All")

Hi Ishan,

There are currently two versions of LCP in the wild, so this seems to be a case of the API using LCP v2 and the DevTools HUD using LCP v1. I'll ask around to confirm that theory.

All CWV-based tools are migrating to LCP v2, but their timelines have not been synced, unfortunately.


Rick

Ishan Anand

unread,
May 25, 2021, 12:49:30 AM5/25/21
to Rick Viscomi, web-vitals-feedback
Thanks for the quick reply Rick! Let us know when that's confirmed. Are there any similar discrepancies we should be aware of when using Performance Observer for CLS and FID?

--
You received this message because you are subscribed to the Google Groups "web-vitals-feedback" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-vitals-feed...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web-vitals-feedback/d2e13a35-e148-487e-8df2-696735af7c78n%40googlegroups.com.

Dan Shappir

unread,
May 25, 2021, 2:34:58 AM5/25/21
to Ishan Anand, Rick Viscomi, web-vitals-feedback
Thanks for the info Rick!
Follow up question: we also collect RUN data using the Web Performance API.
Do we need to implement additional logic above that API in order to align with CrUX?
Or will the discrepancy between v1 and v2 be eventually resolved inside Chrome, underneath the API layer?


Dan Shappir

 

Cell: 054-5404209

40 Hanamal street, Tel Aviv, Israel




Yoav Weiss

unread,
May 25, 2021, 3:04:25 AM5/25/21
to Dan Shappir, Ishan Anand, Rick Viscomi, web-vitals-feedback
We're currently looking into the reported discrepancies, and it's not yet clear what their source is (i.e. we don't yet know that this is a v1/v2 discrepancy). We'd update this thread once we know more.

On Tue, May 25, 2021 at 8:34 AM 'Dan Shappir' via web-vitals-feedback <web-vital...@googlegroups.com> wrote:
Thanks for the info Rick!
Follow up question: we also collect RUN data using the Web Performance API.
Do we need to implement additional logic above that API in order to align with CrUX?

I'd be surprised if the problem is one that would force us towards that kind of a solution. But like I said above, we need to better understand the issue first.
 

Nicolás Peña Moreno

unread,
May 25, 2021, 10:59:25 AM5/25/21
to web-vitals-feedback
It looks like the LCP candidate is an image, and the Timing Allow Origin checks fail. In that case, we can only expose the loadTime to PerformanceObserver, whereas DevTools and other lab tools are able to report renderTime, which is a bit later and is the correct LCP value. In order to get the renderTime in RUM so that you don't see this discrepancy, you'll need to add an appropriate Timing-Allow-Origin header to the cross-origin image that is being surfaced as the LCP, as otherwise we cannot expose the more accurate timing information.

Rick Viscomi

unread,
May 25, 2021, 12:02:37 PM5/25/21
to web-vitals-feedback
To close the loop, this isn't a version issue but rather a limitation of the public APIs as Nicolás explained. More info at https://web.dev/lcp/#load-time-vs.-render-time.


Rick

Ishan Anand

unread,
May 25, 2021, 7:06:26 PM5/25/21
to Rick Viscomi, web-vitals-feedback
We had figured it had to do with permissions of some sort (e.g. one of our original hypotheses was iframes). Thanks for the clarification Nicolas and Rick.

-Ishan

Reply all
Reply to author
Forward
0 new messages