RUM vs synthetic monitoring
- RUM: the true distribution of devices, networks and geography; requires traffic; data only after changes ship.
- Synthetic: repeatable conditions, tests before deployment and on staging environments; cannot capture the diversity of real users.
- Mature monitoring combines both: synthetic for regressions and alerts, RUM for priorities and impact assessment.
What to collect
The minimum is Core Web Vitals (LCP, INP, CLS) broken down by device type, country and page template, plus JavaScript errors and API response times. Analyze percentiles (p75, p95), not averages — an average masks problems affecting a significant minority of users.
Example
A minimal RUM snippet with PerformanceObserver — collects LCP from real visits and sends it to an analytics endpoint.
new PerformanceObserver((list) => {
const entry = list.getEntries().at(-1);
navigator.sendBeacon('/rum', JSON.stringify({
metric: 'LCP',
value: entry.startTime,
path: location.pathname
}));
}).observe({ type: 'largest-contentful-paint', buffered: true });