Private preview Grafana Cloud

Session Replay quickstart

Get your first session recording flowing from your application to Grafana Cloud Frontend Observability.

Note

Session Replay is currently in private preview. Grafana Labs offers support on a best-effort basis, and breaking changes might occur prior to the feature being made generally available.

Before you begin

To use Session Replay, you need:

Step 1: Enable Session Replay for your stack

Session Replay is disabled by default and must be enabled per Grafana Cloud stack.

  1. Open a Grafana Support ticket requesting Session Replay be enabled.
  2. List the Grafana Cloud stacks you’d like to enable it on.

Caution

By enabling Session Replay, you assume responsibility for disclosing session recording to your end users and obtaining any consent required by applicable law. Grafana Labs doesn’t display a consent banner on your behalf. Before you enable Session Replay in production, review Data privacy in Session Replay.

Step 2: Install the Faro Instrumentation Replay package

From your application folder, run:

Bash
npm install @grafana/faro-instrumentation-replay

Step 3: Add ReplayInstrumentation to Faro

In your Faro initialization code, import ReplayInstrumentation and add it to the instrumentations array:

js
import { getWebInstrumentations, initializeFaro } from '@grafana/faro-web-sdk';
import { ReplayInstrumentation } from '@grafana/faro-instrumentation-replay';

initializeFaro({
  url: 'http://faro-collector-us-central-0.grafana.net/collect/{app-key}',
  app: {
    name: 'my-app',
    version: '1.0.0',
  },
  instrumentations: [...getWebInstrumentations(), new ReplayInstrumentation()],
});

With default settings, all input values and text content are masked client-side before anything leaves the browser. You can tune masking, sampling, and other options later. Refer to Instrument Session Replay.

Step 4: Deploy and generate a session

  1. Deploy your application with the updated Faro configuration.
  2. Open the application in a browser.
  3. Navigate through a few pages, click around, and interact with the app for at least a few seconds.

Step 5: View your recording

  1. In Grafana Cloud, go to Frontend Observability.
  2. Select your application.
  3. Open the Sessions tab.
  4. Find your session in the list and open it to watch the recording.

After a session is recorded, it can take up to five minutes for the recording to appear. For ongoing sessions, new portions of the recording also appear in intervals of up to five minutes. You can’t watch a live session in real time.

Next steps