Observability

Session replay

This feature is in Early Access

LaunchDarkly’s observability features are publicly available in early access.

They currently require the LaunchDarkly observability plugins and the JavaScript SDK. If you are interested participating in the Early Access Program for our upcoming observability plugins for server-side SDKs, sign up here.

Overview

This topic explains how to use LaunchDarkly’s observability features to perform session replays. The Sessions view displays a list of recorded sessions. Use this view to perform session replays, which are repeatable explorations of an end user’s session in your application.

Get started

To instrument your application to capture session replay, read the SDK documentation on Observability. The functionality is available through plugins to the LaunchDarkly JavaScript SDK.

LaunchDarkly supports both Shadow DOM and Web Components as part of this instrumentation.

View session replays

To view a session replay, click Sessions in the left navigation menu, and then select a session from the list. Press the Play button to start the replay. Hover over or click on the colorful columns at the bottom of the screen to see different events in the session.

A session replay with event details expanded.

A session replay with event details expanded.

To learn more about the search capabilities, read Search specification.

When you search on the Sessions page, the following behaviors apply by default:

  • The Sessions page displays completed sessions that have been fully processed. This is equivalent to searching by completed=true. You can use completed=false to find live sessions and sessions that are not yet fully processed.
  • The default search key is assumed to include the end user’s identifier and location. This could be the end user’s email, device_id, or given identifier, as well as their city or country. For example, if you enter an expression without a key, such as search-term, then LaunchDarkly automatically expands that to email=*search-term* OR city=*search-term*.

Additionally, by default, the session replay SDK plugin automatically injects several attributes, to provide additional help with searching for sessions. To learn more, read Session replay.

Search by end user clicks

When you search on the Sessions page, you can search for sessions where an end user clicked a certain HTML element:

  • clickSelector looks at the HTML element’s target’s selector, concatenating the element’s tag, id, and class values.
  • clickTextContent looks at the HTML element’s target’s textContent property. Only the first 2000 characters are considered.

Here is an example:

Example query
clickSelector=svg
clickTextContent="Last 30 days"

Search by visited URL

When you search on the Sessions page, you can search for sessions where an end user visited a particular URL, using the visited-url filter. Use quotations around the value for this search to avoid any errors due to special characters in the the URL.

Here’s how:

Example query
visited-url="https://app.example.com/"

As with other filters, you can use contains and matches regex expressions with visited-url. The following example retrieves all sessions where the end user visited the “sessions” page:

Example query
visited-url=*sessions*
visited-url=/.+\d/sessions.+/

Search attributes

By default, the session replay SDK plugin automatically injects the following attributes to provide additional help with searching for sessions:

AttributeDescriptionExample
active_lengthTime the end user was active. Defaults to milliseconds. Use s, m, or h suffixes to designate seconds, minutes, or hours.10m
browser_nameBrowser the end user was using.Chrome
browser_versionBrowser version the end user was using.124.0.0.0
cityCity the end user was in.San Francisco
completedWhether the session has finished recording.true
countryCountry the end user was in.Greece
device_idFingerprint of the end user’s device.1018613574
environmentThe environment key, based on the SDK credentials used in the SDK plugin.production
first_timeWhether this is the end user’s first session.false
has_commentsWhether a LaunchDarkly member has commented on the session.true
has_errorsWhether the session contains linked errors.true
has_rage_clicksWhether the end user rage clicked in the session.true
identifiedWhether the session successfully identified the end user.false
identifierThe observability project ID passed to the session replay plugin initialization.1jdkoe52
ipThe IP address of the end user.127.0.0.1
lengthThe total length of the session. Defaults to milliseconds. Use s, m, or h suffixes to designate seconds, minutes, or hours.10m
os_nameThe end user’s operating system.Mac OS X
os_versionThe end user’s operating system version.10.15.7
pages_visitedThe number of pages visited in the session.10
sampleA unique order by which to sample sessions.c1c9b1137183cbb1
service_versionThe version of the service specified in the session replay SDK plugin. To learn more, read Versioning sessions and errors.e1845285cb360410aee05c61dd0cc57f85afe6da
stateThe state the end user was in.Virginia
viewed_by_anyoneWhether the session has been viewed by any LaunchDarkly member.true
viewed_by_meWhether you have viewed the session.false

Filter

You can filter out sessions that you do not want to view in LaunchDarkly. This is useful for sessions that you know are not relevant to your application, or that are not actionable. Filtered sessions do not count against your sessions quota.

Ingestion filters

You can set up ingestion filters to limit the number of sessions recorded in the following ways:

  • Sample a percentage of all data. For example, you may configure ingestion of 1% of all sessions. For each session LaunchDarkly receives, it makes a randomized decision that results in storing only 1% of all sessions.
  • Rate limit the maximum number of data points ingested in a one minute window. For example, you may configure a rate limit of 100 sessions per minute. This lets you limit the number of sessions recorded in case of a significant spike in use of your application.
  • Exclude sessions from particular end users, based on their context key or email address.

You can configure these filters from your project settings. To learn how, read Monitoring settings.

Custom filters

To use filter logic that is not available in the project settings, use the session replay plugin’s options for starting and stopping sessions at your discretion. To learn how, read Manually control session recording.

Privacy

Session replay supports privacy features, including data obfuscation and redaction. This ensures that sensitive data is not captured or displayed in the session replays. All of this functionality happens client-side, which means that no sensitive data is sent to LaunchDarkly servers. To learn more about the privacy options for session replay, read Privacy in the SDK documentation.

How is a session defined?

After a session starts, LaunchDarkly continues recording in the same session for up to four hours. Each browser tab or instance will start a distinct session, so if your web app is opened in two tabs at once, LaunchDarkly records two sessions.

However, after a session starts, it can be resumed. If your web app is opened in a single tab, closed, and then reopened within 15 minutes of closing, LaunchDarkly resumes the existing session. If more than 15 minutes have passed, LaunchDarkly starts a new session.

“Active time” is the time when an end user is interacting with your application with no more than a 10-second gap in activity. For example, if an end user is moving their mouse, typing, or clicking for 30 seconds with no gaps of longer than 10 seconds, that counts as 30 seconds of active time.