Frontend observability ΒΆ

Nais provides frontend observability through the Grafana Faro Web SDK. Faro runs in the browser and instruments your app, shipping telemetry through the platform collector (Alloy) into the shared observability stores: errors and events land in Loki, browser spans in Tempo, and Core Web Vitals in Mimir. You then view and triage it all in Nais APM.

With 95+ applications already using Faro, it's the standard way to monitor frontend applications on Nais.

What you get ΒΆ

  • Core Web Vitals β€” TTFB, FCP, CLS, LCP, INP (collected automatically)
  • Logging β€” console.info, console.warn, and console.error messages
  • Exceptions β€” stack traces with automatic sourcemap deobfuscation
  • Custom events and metrics β€” anything you want to track
  • Tracing β€” OpenTelemetry-based browser traces, optionally connected to backend spans

Get started ΒΆ

  1. Any frontend app: 🎯 Set up Faro
  2. Next.js App Router: Set up Faro with Next.js
  3. Want end-to-end traces? Connect frontend to backend
  4. Stack traces look minified? Sourcemaps Β· Troubleshooting

After the basic setup, check that you have these configured:

SettingWhy it mattersGuide
beforeSend PII filteringFaro captures URLs and console output that may contain fΓΈdselsnummer or tokensPrivacy and sensitive data
propagateTraceHeaderCorsUrlsWithout this, browser traces never connect to your backend spansTrace propagation
paused on localhostPrevents local development noise from polluting production dashboardsLocal development
app.versionLets you filter errors and metrics by deploySetting app.version
Error boundaryCatches React rendering errors that are otherwise silently lostReact error boundaries

Collector endpoints ΒΆ

The collector URL tells Faro where to send telemetry data. If you use the auto-configuration in nais.yaml, this is set for you.

Collector endpointEnvironment
https://telemetry.external.prod.ssb.cloud.nais.io/collectprod
https://telemetry.external.dev.ssb.cloud.nais.io/collectdev

On-premises clusters are not supported.

Inspecting frontend data in Grafana ΒΆ

Find your app in the Nais APM service inventory and open it. Browser telemetry surfaces on two tabs:

  • Frontend β€” Core Web Vitals, pageloads, sessions, per-page performance, browser breakdown, and web-vitals attribution (what's driving LCP, INP, and CLS).
  • Issues β€” browser exceptions grouped into issues, side by side with backend errors. Filter the source to Browser to isolate frontend errors, then open an issue for its stack trace and impact.

Nais APM Issues tab filtered to browser-sourced exceptions

For deeper analysis, use the Explore view with one of the Loki data sources. Here are some useful queries:

logql

Traces are available from data sources ending with -tempo. Use TraceQL to query them.

Local development ΒΆ

For local development, check out the tracing demo repository and run docker-compose up. This gives you a local Grafana, Loki, and Tempo stack to test against. See the README in that repository for details.

Guides ΒΆ

GuideDescription
Set up FaroInstall, configure, and deploy Faro in any frontend app
Next.js App RouterFaro integration for Next.js with App Router
Custom metricsSend custom measurements and query them in Grafana
Trace propagationConnect frontend traces to backend spans
SourcemapsHow stack trace deobfuscation works
Auto-configurationGenerated config values and environment variables
TroubleshootingCSP, CORS, and common issues

Further reading ΒΆ