Grafana Faro RUM
Sends Real User Monitoring data from OutSystems 11 Reactive Web apps to Grafana (Grafana Cloud Frontend Observability or Grafana Alloy), using the Grafana Faro Web SDK 2.12.1.
Records page loads, web vitals, JS errors, OutSystems exceptions you report, view changes, custom events and logs, user id, and optional fetch/XHR traces.
No CDN at runtime: the Faro scripts ship inside the module. No proxy: the browser posts straight to Grafana. Fails silent: if disabled, misconfigured or the collector is down, the app runs as if the component were not there.
Requirements
1. Create the Grafana app
The URL is visible in the browser. It is an ingest address, not a secret. Protect it with CORS.
2. Install
Enabled = True
CollectorUrl = the URL you copied
Environment = dev, qa or prod (optional)
Site property values are per environment and are not moved by deployments. Set them in each environment. No republish is needed to change them.
After you update the component, republish every app that uses it. A Reactive app serves the component's scripts from its own published copy.
3. Check it works
In the browser console:
OSFaro.getStatus()
Expect initialized: true and a sessionId. OSFaro is not defined means Faro did not start.
In the Network tab, filter on collect: POSTs to your collector should return 202.
4. Site properties
Module GrafanaFaroRUM. Take effect on the next page load.
5. Client actions
All are public, never raise, and do nothing when Faro is not running. *Json inputs take a flat JSON object. Invalid JSON is ignored. Values are sent as text.
6. Common patterns
Report handled exceptions. Exceptions caught in an OnException handler never reach the browser's error handler. In the handler, call Faro_ReportException with ExceptionMessage = AllExceptions.ExceptionMessage.
Identify the user. Call Faro_SetUser(UserId) after login and Faro_ResetUser on logout. Faro keeps the session across page reloads but not the user, so set it again after each full page load. Or set AutoSetUser to True.
Consent. Set StartPaused to True. Call Faro_Resume when the user agrees and Faro_Pause if they withdraw.
Support. Show the SessionId from Faro_GetStatus on error screens so support can find the session in Grafana.
Business dimensions. Put tenant, region or release in GlobalAttributesJson.
7. Behaviour to know
8. Find your data
Frontend Apps > your app: overview (page loads, errors, web vitals) and the Sessions tab, which shows one session's events, logs and errors in order.
Explore > your stack's logs data source (Loki). The app name is the service_name label:
{service_name="YourAppName"} |= "demo_click"
{service_name="YourAppName"} | logfmt | user_id != ""
Fields such as event_name, user_id and session_id are inside the log line, not labels.
Traces (tracing on): the traces data source (Tempo), search by app name.
Data can take a minute or two. Check the time range first.
9. CSP
No script-src change: the scripts are served from your own app. Add the collector host to connect-src:
connect-src 'self' https://faro-collector-prod-ap-southeast-1.grafana.net
10. Privacy
Sent by default: page URL without query string or fragment, browser, OS and viewport details, page and resource timings, web vitals, JS errors with stack traces, view changes, a random session id.
Not sent unless you turn on SendUserIdentity and pass them: names and emails.
Watch for:
11. Tracing
With TracingEnabled True, fetch and XHR calls become spans. traceparent is added to same-origin requests only. To allow another host, list it in TracePropagationUrls, for example ^https://api\.example\.com/. It is never added to third parties by default.
The browser spans always appear. Linking them to back-end traces needs a back end that honours traceparent. OutSystems server-side continuation is not guaranteed.
12. Demo app
GrafanaFaroRUM_Demo has a layout with the FaroRUM block, a Home screen and a Second screen. Home has a status panel and buttons for: JS error, OutSystems exception, custom event, log, set and reset user, pause and resume, a server call, and navigation to Second. Set Enabled and CollectorUrl, click through, and watch Grafana.
13. Troubleshooting