RousselTMLEARNING

Observability

Using Faro data: queries, dashboards, alerts and GDPR

Query Faro data in Loki (Web Vitals, errors, events), build dashboards and alerts, and comply with GDPR: consent, minimization, sampling.

1. Querying Loki #

Faro signals are structured logs.

LogQL queries #

Each Faro signal arrives in Loki as a logfmt line, with a kind field (measurement, exception, log, event) and metadata (application, version, page, browser, session).

# Erreurs JavaScript par message
sum by (value) (count_over_time({app_name="boutique"} | logfmt | kind="exception" [1h]))

# LCP au 75e percentile par page
quantile_over_time(0.75, {app_name="boutique"} | logfmt | kind="measurement" | lcp != "" | unwrap lcp [15m]) by (page_url)

# Événements « ajout_panier » par version
sum by (app_version) (count_over_time({app_name="boutique"} | logfmt | kind="event" | event_name="ajout_panier" [1h]))
Good to know: The exact label and field names depend on the Alloy version and your configuration: open a line in Explore to check them before writing a dashboard.

2. Dashboards and alerts #

Tracking the user experience.

A front-end dashboard #

PanelContent
Web Vitals p75LCP, INP, CLS per page and per version
ErrorsNumber of exceptions, top 10 messages, affected browsers
VolumeSessions, page views
Slow requestsfetch traces > 1 s
ConversionBusiness event funnel

Alerts #

# Règle Loki (ruler) ou Grafana : pic d'erreurs JavaScript après un déploiement
sum(count_over_time({app_name="boutique"} | logfmt | kind="exception" [10m])) > 50
Good practice: Always compare by app_version: an error increase limited to the latest version immediately points to the faulty deployment.

3. GDPR and privacy #

Measuring without tracking.

Rules #

PrincipleImplementation
ConsentIf collection is not strictly necessary, initialize Faro only after consent (consent banner)
MinimizationNo email, name or form content; URLs cleaned of sensitive parameters
PseudonymizationTechnical user identifier, never a direct one
SamplingsamplingRate to collect only part of the sessions
RetentionShort Loki retention for this data (30 days for example)
initializeFaro({
  // ...
  beforeSend: (item) => {
    // retirer les paramètres d'URL des métadonnées de page
    if (item.meta?.page?.url) item.meta.page.url = item.meta.page.url.split('?')[0];
    return item;
  },
  ignoreErrors: [/ResizeObserver loop/, /Script error\./],
});

Related articles

Conversion funnels in RUM: measuring where users drop off

Building and reading a conversion funnel with RUM data: steps, rates, order, pitfalls, and implementation in …

Website monitoring: availability, HTTPS monitoring, certificates and performance

Set up website monitoring: availability and HTTPS checks, certificate expiry, response time, Core Web Vitals …

Real User Monitoring (RUM) and Core Web Vitals: measuring what users experience

Why observe the front end, what RUM measures, Core Web Vitals (LCP, INP, CLS) and their thresholds, and the d…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!