Frontend observability ΒΆ

Nais provides frontend observability through the Grafana Faro Web SDK. Faro runs in the browser and sends telemetry data (metrics, logs, errors, traces) to a collector on the Nais platform.

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

What you get ΒΆ

Frontend Web Vitals dashboard showing Core Web Vitals, CWV rating, and performance trends

  • 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.nav.no/collectprod
https://telemetry.ekstern.dev.nav.no/collectdev

On-premises clusters are not supported.

Inspecting frontend data in Grafana ΒΆ

Find your app in the Nais APM service list. Frontend apps show with a Node.js badge.

Nais APM service list showing frontend and backend apps

Go to the Frontend tab for Core Web Vitals, or the Logs tab to search exceptions and browser logs. Toggle Include browser telemetry to see Faro data alongside server logs.

APM Logs tab filtered by exceptions, showing browser telemetry

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
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 ΒΆ