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.
Search
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 usecompleted=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 givenidentifier
, as well as theircity
orcountry
. For example, if you enter an expression without a key, such assearch-term
, then LaunchDarkly automatically expands that toemail=*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’stag
,id
, andclass
values.clickTextContent
looks at the HTML element’s target’stextContent
property. Only the first 2000 characters are considered.
Here is an example:
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:
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:
Search attributes
By default, the session replay SDK plugin automatically injects the following attributes to provide additional help with searching for sessions:
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.