Real User Monitoring (RUM) Setup
Real User Monitoring captures page performance from actual users—with their specific devices, networks, and browsers. Synthetic monitoring shows the ideal picture; RUM shows reality.
What RUM Collects
Key Web Vitals: LCP (Largest Contentful Paint), FID/INP (First Input Delay / Interaction to Next Paint), CLS (Cumulative Layout Shift), TTFB (Time to First Byte), FCP.
Additionally—JavaScript errors, network requests, resource load time, SPA page navigation, geographic distribution of latency.
Tools
| Tool | Features | Best For |
|---|---|---|
| Datadog RUM | Session replays, alerts | Large applications |
| New Relic Browser | Backend APM integration | Full-stack monitoring |
| Sentry Performance | Traces + errors together | Startups, SaaS |
| Grafana Faro | Open-source, self-hosted | Data control |
| web-vitals (Google) | Lightweight library | Basic collection |
Implementation via web-vitals + Custom Endpoint
Minimalist approach without third-party SaaS—the web-vitals library sends metrics to your server:
import { onCLS, onFCP, onLCP, onTTFB, onINP } from 'web-vitals';
function sendToAnalytics({ name, value, id, rating }) {
navigator.sendBeacon('/api/rum', JSON.stringify({
metric: name, value: Math.round(value),
id, rating, url: location.href,
ua: navigator.userAgent, ts: Date.now()
}));
}
onCLS(sendToAnalytics);
onFCP(sendToAnalytics);
onLCP(sendToAnalytics);
onTTFB(sendToAnalytics);
onINP(sendToAnalytics);
Data is written to ClickHouse—it efficiently stores time series and builds percentile reports.
Data Segmentation
Raw averages are useless. Segment by:
- Device—mobile/desktop/tablet
- Country/region—CDN latency varies significantly
- Connection type—4G, WiFi, 3G
- Browser version—especially with legacy support
-
Route—
/checkoutis slower than/catalog
Alerts and Thresholds
Set alerts on p75 (75th percentile), not average. Google rates LCP as "good" at p75 < 2.5 sec. If p75 LCP on mobile exceeds 4 sec—that's a direct signal to optimize.
Timeline
Basic implementation with metric shipping and Grafana dashboard—1–2 days. Integration with Datadog or New Relic with session replays and alerts—3–5 days.







