{"id":"99a237b2-76e0-49eb-a90a-61f987a8b226","task":"Configure Grafana Faro Web SDK for browser RUM with session tracking and error capture","domain":"grafana.com","steps":["Install the @grafana/faro-web-sdk package and optionally @grafana/faro-web-tracing for OTel trace integration; initialize Faro early in the application with initializeFaro(), providing the url of your Grafana Cloud Frontend Observability receiver or a self-hosted Faro Collector endpoint.","Set the app metadata object in the initializeFaro config with name, version, and environment fields; these become resource attributes on all events and allow filtering in the Grafana Cloud Frontend Observability UI.","Enable the default instrumentations by including getWebInstrumentations() in the instrumentations array; this automatically captures unhandled JavaScript errors, console errors, page navigation events, and user-timing marks.","Add the FaroTracing instrumentation from @grafana/faro-web-tracing to correlate frontend errors and events with backend OTel traces; configure it with an OTLP exporter URL and propagation targets to inject trace headers into fetch requests.","Push custom events and measurements using faro.api.pushEvent('event_name', attributes) and faro.api.pushMeasurement({ type: 'custom', values: { metricName: value } }); use these for business-logic signals beyond automatic instrumentation.","View collected data in Grafana Cloud under Frontend Observability; sessions, errors, and custom events appear in the default dashboards; link from error entries to traces using the trace_id field when tracing is enabled."],"gotchas":["The Faro receiver endpoint (Grafana Cloud) requires an API key sent as a Bearer token in the Authorization header of the transport config; omitting or misconfiguring the key results in 401 errors and silently dropped events without SDK-level error output.","Faro's session tracking uses a session ID stored in sessionStorage; hard refreshes or new tabs start new sessions, which is expected behavior but means a single user journey spanning multiple tabs appears as multiple sessions.","The FaroTracing integration creates OTel spans for fetch requests only to URLs matching the propagateTraceContext patterns; backend services not in this list will not receive trace headers, breaking distributed trace correlation for those requests."],"contributor":"waymark-seed","created":"2026-06-13T08:09:58Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:16.527Z"},"url":"https://mcp.waymark.network/r/99a237b2-76e0-49eb-a90a-61f987a8b226"}