Core Web Vitals monitoring with RUM: measuring LCP, INP and CLS in production and fixing what slows users down
What LCP, INP and CLS measure, why field data at the 75th percentile is what counts, how to collect Web Vitals with real user monitoring, trace slow interactions to their cause and alert on them with SLOs.
Summary
- Core Web Vitals monitoring means measuring LCP, INP and CLS for real users in production and judging each page group by its 75th percentile, separately for mobile and desktop.
- Lab tools like Lighthouse are useful for debugging, but only field data from CrUX or your own real user monitoring shows what users actually experience, and only RUM tells you why with attribution data.
- Connecting RUM sessions to backend traces, tracking the share of good page views as an SLO and alerting on burn rate turns Web Vitals from a quarterly SEO report into an operational signal.
Core Web Vitals monitoring answers a simple question: how fast, responsive and visually stable does your site feel to the people who actually use it? Google's three Core Web Vitals, Largest Contentful Paint (LCP), Interaction to Next Paint (INP) and Cumulative Layout Shift (CLS), turn that question into numbers with published thresholds, and they are used as a signal in Google Search. That makes them interesting for SEO teams, but they are just as useful for engineering: a regression in INP after a release is a production problem, not a marketing statistic.
This guide covers the metrics and thresholds, field versus lab data, the 75th percentile, collecting Web Vitals with real user monitoring (RUM), attribution, the link to backend traces, and SLOs and alerts. It ends with a checklist you can copy.
LCP, INP and CLS: what they measure and their thresholds
Each of the three Core Web Vitals covers one aspect of user experience:
- Largest Contentful Paint (LCP) measures loading: the time from the start of navigation until the largest image or text block in the viewport is rendered. It stops being updated once the user interacts with the page.
- Interaction to Next Paint (INP) measures responsiveness: for clicks, taps and key presses during the whole page visit, the time from the input until the browser paints the next frame. The reported value is close to the slowest interaction; on pages with many interactions, one outlier per 50 interactions is ignored. INP replaced First Input Delay (FID) as a Core Web Vital in March 2024. FID only measured the delay before the first event handler started; INP covers every interaction and includes processing and rendering time.
- Cumulative Layout Shift (CLS) measures visual stability: how much visible content moves unexpectedly. Shifts are grouped into session windows (at most 5 seconds long, with less than 1 second between shifts), and CLS is the largest window. Shifts within 500 ms after a user input are excluded, because users expect the page to react.
The thresholds published on web.dev are:
| Metric | Good | Needs improvement | Poor |
|---|---|---|---|
| LCP | ≤ 2.5 s | 2.5 s to 4.0 s | > 4.0 s |
| INP | ≤ 200 ms | 200 ms to 500 ms | > 500 ms |
| CLS | ≤ 0.1 | 0.1 to 0.25 | > 0.25 |
A page passes the Core Web Vitals assessment when all three metrics are in the good range at the 75th percentile. Two further metrics are not Core Web Vitals but are worth collecting because they explain LCP: Time to First Byte (TTFB) and First Contentful Paint (FCP).
Field data vs. lab data: CrUX, Lighthouse and your own RUM
There are two fundamentally different ways to measure Web Vitals, and confusing them leads teams to optimise the wrong thing.
Lab data comes from a controlled test: Lighthouse, Chrome DevTools or a synthetic monitoring check loads a page on a defined device and network profile. Lab data is reproducible and great for debugging and for catching regressions before release. But it measures one device, one network and usually one cold page load. A standard Lighthouse navigation run does not click anything, so it cannot measure INP; it reports Total Blocking Time (TBT) as a lab proxy instead.
Field data comes from real visits. The public source is the Chrome User Experience Report (CrUX), which aggregates data from Chrome users who opted in, over a rolling 28-day window, at origin level and for sufficiently popular URLs. PageSpeed Insights and the Core Web Vitals report in Google Search Console are built on CrUX. CrUX is what Google uses, but it has limits for engineering work: it only covers Chrome, it lags by up to four weeks, low-traffic pages often have no data, and it tells you that a page is slow, not why.
That is where your own real user monitoring comes in. RUM collects the same metrics from every supported browser on your site, in near real time, with your own dimensions (route, release, device class, country, logged-in state) and with attribution data that points to the element, resource or script responsible.
| Source | Type | Strengths | Limits |
|---|---|---|---|
| Lighthouse / DevTools | Lab | Reproducible, detailed diagnostics, works before release | One device and network; no INP, only TBT as proxy |
| Synthetic checks | Lab, scheduled | Continuous baseline, catches outages and regressions | Scripted paths, not real user behaviour |
| CrUX / PageSpeed Insights / Search Console | Field, aggregated | What Google sees; no setup | Chrome only, 28-day window, no root cause |
| Your own RUM | Field, per page view | Real time, all segments, attribution, link to backend | Needs instrumentation and storage |
Why the 75th percentile matters
Google evaluates every Core Web Vital at the 75th percentile of page views, segmented by mobile and desktop. The choice is deliberate: an average is pulled around by a few extreme values and hides how many users have a bad experience, while the 99th percentile is dominated by broken devices and networks you cannot fix. The 75th percentile means that at least three out of four visits meet the threshold.
For monitoring, this has three consequences:
- Never report averages. An average LCP of 1.9 s can sit next to a p75 of 3.2 s. Dashboards should show p75 (and p95 for debugging), not the mean.
- Segment before you aggregate. Mobile and desktop are assessed separately, and mobile is almost always worse. A combined p75 hides a failing mobile experience behind fast desktop traffic. Segment by page group (product page, search, checkout) as well, because each has a different bottleneck.
- Think in shares of good page views. "p75 LCP ≤ 2.5 s" is mathematically the same statement as "at least 75 % of page views have LCP ≤ 2.5 s". The second form is easier to track over time and maps directly onto an SLO, as shown further below.
Collecting Web Vitals in production with RUM
The browser exposes the raw data through the Performance APIs (Largest Contentful Paint API, Event Timing API, Layout Instability API), but computing the metrics correctly is surprisingly tricky: back/forward cache restores, pages opened in background tabs, prerendering and the session-window logic of CLS all need special handling. The open-source web-vitals library maintained by the Chrome team handles these cases and matches how Chrome and CrUX measure. It exports onLCP, onINP, onCLS, onFCP and onTTFB; the old onFID function has been removed in current versions.
Each callback receives a metric object with name, value, rating ("good", "needs-improvement" or "poor"), delta, id and navigationType. Because INP and CLS can change until the page is hidden, the recommended pattern is to queue metrics and send them with navigator.sendBeacon() when the page becomes hidden:
// Example: collect Core Web Vitals with attribution and send them in one beacon
import {onLCP, onINP, onCLS, onTTFB} from 'web-vitals/attribution';
const queue = new Map();
function record(metric) {
const a = metric.attribution || {};
queue.set(metric.id, {
name: metric.name,
value: metric.value,
rating: metric.rating,
id: metric.id,
navigationType: metric.navigationType,
route: document.body.dataset.route, // route template, not the raw URL
release: document.body.dataset.release,
target: a.target || a.interactionTarget || a.largestShiftTarget,
interactionType: a.interactionType,
inputDelay: a.inputDelay,
processingDuration: a.processingDuration,
presentationDelay: a.presentationDelay,
});
}
function flush() {
if (queue.size === 0) return;
navigator.sendBeacon('/rum/vitals', JSON.stringify([...queue.values()]));
queue.clear();
}
onLCP(record);
onINP(record);
onCLS(record);
onTTFB(record);
addEventListener('visibilitychange', () => {
if (document.visibilityState === 'hidden') flush();
});
A few practical rules for production:
- Use route templates, not URLs.
/product/{id}keeps cardinality manageable and avoids sending query strings that may contain personal data. - Add release and device dimensions so you can compare before and after a deploy and keep mobile and desktop apart.
- Single-page applications need care. Core Web Vitals are defined per page load; client-side route changes ("soft navigations") are not counted as new page loads by CrUX. Report the route that was active when each metric was finalised, and treat soft-navigation measurement as experimental.
- Browser support differs. Chromium-based browsers support all three metrics; support in other engines varies, so check MDN and expect fewer samples from some browsers.
Attributing slow LCP, INP and CLS to their causes
A p75 number tells you there is a problem. The attribution build of the library (web-vitals/attribution) tells you where it is, at the cost of a slightly larger bundle.
LCP: four sub-parts
LCP attribution includes the target element, the resource url and a breakdown into timeToFirstByte, resourceLoadDelay, resourceLoadDuration and elementRenderDelay. High TTFB points to the server, CDN or redirects. A large resource load delay means the browser discovered the LCP image late, for example because it is set via CSS or injected by JavaScript. A long load duration means the file is too big or served from far away. A large render delay usually means render-blocking CSS or scripts, or client-side rendering that runs before the element appears.
INP: three phases
INP attribution reports the interactionTarget (a selector for the element that was clicked or typed into), the interactionType, the loadState at the time of interaction and three phases: inputDelay (the main thread was busy with something else), processingDuration (your event handlers) and presentationDelay (style, layout and paint of the next frame). It also includes longAnimationFrameEntries from the Long Animation Frames API, which name the scripts that ran during the slow frame. That is how you find out whether the culprit is your own handler, a third-party tag or a hydration task that happened to run at the same time.
CLS: the largest shift
CLS attribution reports the largestShiftTarget, the time and value of the largest shift and the loadState. Typical causes: images without dimensions, late ads or embeds, cookie banners and font swaps.
Aggregate attribution data by target and route: "the add-to-cart button on /product/{id} accounts for most poor INP on mobile" is an actionable ticket. Where the numbers alone are not enough, session replay shows what the user did right before a slow interaction or layout shift.
Connecting frontend sessions to backend traces
A poor LCP is often not a frontend problem at all. If TTFB makes up most of the LCP time, the cause sits in the backend, and you want to jump from the slow page view straight to the server-side trace. There are two common ways to make that connection:
- Propagate trace context from the browser. OpenTelemetry for the browser can instrument document load,
fetchandXMLHttpRequestand send the W3Ctraceparentheader with API calls. For cross-origin APIs, list the allowed origins in the instrumentation and allow thetraceparentheader in your CORS configuration. Note that OpenTelemetry browser instrumentation is still marked experimental. - Return the server trace to the browser. The server can render the active trace context into the HTML (for example as
<meta name="traceparent" content="00-…">, which the OpenTelemetry document-load instrumentation reads) or add it to aServer-Timingresponse header, which is exposed on the navigation timing entry. Store the trace ID with the RUM page view, and the slow document request becomes one click away.
With this link in place, distributed tracing continues the story: a page view with LCP of 4.8 s leads to a document request with TTFB of 2.9 s, which leads to a trace in which a single database query took 2.4 s.
A practical Web Vitals improvement checklist
Use attribution data to decide which items apply; not every page needs every fix.
Core Web Vitals improvement checklist
- LCP: make the LCP image discoverable in the initial HTML, never lazy-load it, and give it
fetchpriority="high" - LCP: reduce TTFB with caching, a CDN and fewer redirects; consider server-side rendering for the main content
- LCP: serve correctly sized, modern image formats and remove render-blocking CSS and scripts from the critical path
- INP: break up long tasks and yield to the main thread (for example with
scheduler.yield()where supported, orsetTimeoutas fallback) - INP: give immediate visual feedback first and defer non-urgent work in event handlers
- INP: audit third-party tags and load them later or remove them; check hydration cost in JavaScript frameworks
- CLS: set
widthandheight(oraspect-ratio) on images, videos and iframes - CLS: reserve space for ads, embeds and banners; never insert content above existing content without user input
- CLS: preload key fonts and use matching fallback font metrics; animate with
transforminstead of layout properties - All: keep pages eligible for the back/forward cache, which makes back navigations near-instant
- All: verify every fix in RUM at p75 per device class, not only in Lighthouse
Alerting and SLOs on Web Vitals
Web Vitals are noisy per page view but stable in aggregate, a good fit for service level objectives rather than static per-minute thresholds. Define the SLI as the share of good page views, per page group and device class. For example:
# Example SLOs (values are examples, adjust to your baseline)
SLO checkout-lcp-mobile:
SLI: page views on /checkout/* (mobile) with LCP <= 2500 ms / all such page views
target: 80 % over 28 days
SLO product-inp-mobile:
SLI: page views on /product/* (mobile) with INP <= 200 ms / all such page views with an interaction
target: 80 % over 28 days
A target slightly above 75 % gives you a safety margin before the Core Web Vitals assessment flips, and the 28-day window mirrors CrUX. Alert on burn rate instead of single values: a fast burn (the error budget is being consumed many times faster than planned over the last hour) usually means a bad release or a broken third-party script and is worth a page; a slow burn over days is a ticket for the next sprint. Our article on SLOs in practice explains how to choose windows and burn-rate thresholds.
Two more habits make Web Vitals alerts actionable. First, put deployment markers on every Web Vitals dashboard so a regression lines up with the release that caused it. Second, require a minimum number of page views per evaluation window, so a page group with little traffic at night does not trigger alerts on a handful of slow visits. Uptime and synthetic checks still matter alongside RUM: our website uptime monitoring guide covers that layer.
How Obseria helps with Core Web Vitals monitoring
Obseria includes real user monitoring as part of an OpenTelemetry-native observability platform, so LCP, INP and CLS from real sessions sit next to backend traces, logs and infrastructure metrics instead of in a separate tool. Web Vitals are shown at p75 per route, device class and release, with attribution down to the element and script.
- RUM page views carry the trace ID of the document request, so a slow LCP leads directly to the backend trace behind it.
- Obseria Pipeline masks personal data in URLs and attributes before RUM data is stored in the EU.
- SLOs with burn-rate alerts work on the share of good page views per page group.
- Obseria Intelligence correlates a Web Vitals regression with deploys, slow services and third-party changes, with evidence.
You can measure Core Web Vitals from your own users within minutes with a free Obseria trial.