ObservabilityObservability

Session replays

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.

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.

Configure session views

You can configure session views to display different types of data. Use the date dropdown to select a time range, and the filter button to sort the sessions. Click the download button to export a CSV of sessions.

The session replay search pane, with options expanded.

The session replay search pane, with options expanded.

Search is a powerful feature that allows you to filter sessions based on different properties.

Compose your search query with one or more expressions. Each expression can be a comparison between a key and a value, or a logical combination of other expressions.

Here are some examples of search queries:

Example query
span_name=gorm.Query

Enter a search value without a key to search on a default key. For logs, the default key is the message, and for traces it is the span_name.

Example query
gorm.Query

You can also filter for custom attributes you send in sessions, logs, and traces.

Example filter
user_id=42

Keys and values

Keys are identifiers, which can include any combination of alphanumeric characters, underscores (_), periods (.), dashes (-), and wildcards, which are indicated by asterisks (*).

Values are strings with any character. To use spaces or special characters, you must enclose the string in quotes (", ').

You can use wildcards (*) in values to match on part of a pattern. For example:

  • span_name=gorm.* matches all span_name values that start with gorm.
  • span_name=*.Query matches all span_name values that end with .Query
  • span_name=*orm* matches all values that contain orm

If you want to use a value with a space or special character, you must wrap the value in quotations.

Example query
tag="*query error*"
visited-url="https://app.launchdarkly.com/*"

Regex expressions

You can search with regex expressions by using the matches query operator: =\[your regex here]\. For example:

  • clickTextContent=/\w.+\w/ matches all clickTextContent that start and end with any word
  • browser_version=/\d\.\d\.\d/ matches all browser_versions in the form [0-9].[0-9].[0-9]

If you want to use a regex expression with a space or special character, you must wrap the value in quotations. For example:

  • tag="/\w \w/"
  • visited-url="/https://app.launchdarkly.com/\d/.+/"

Comparisons

Use operators to compare two different elements in your search query. The following operators are supported:

  • =: Equals
  • !=: Does not equal
  • <: Less than
  • <=: Less than or equal to
  • >: Greater than
  • >=: Greater than or equal to

Exist and does not exist

You can search if a key exists or does not exist with the exists operator. For example, to return all the traces with a connected session, use the following query:

Example query
secure_session_id exists

exists also works with the not keyword. For example, when you only want the root level spans when searching traces, use this query:

Example query
parent_span_id not exists

You can combine expressions with the logical operators AND, OR, and NOT:

  • AND: Both expressions must be true
  • OR: At least one of the expressions must be true
  • NOT: The following expression must be false

There is an implicit AND between all filters unless you specify an OR directly. For example:

Example query
service_name=private-graph span_name=gorm.Query

This is equivalent to:

Example query
service_name=private-graph AND span_name=gorm.Query

You can also use parentheses ( AND ) to group values in an expression. For example:

Example query
(key1=value1 AND key2=value2) OR key3=value3

You can also use parentheses to group values in an expression:

Example query
service_name=(private-graph OR public-graph)

Saved searches

Saved searches are a set of search filters that apply to sessions or errors. Saved searches are useful if you want to quickly view sessions or errors that relate to a certain population of your users.

To save a search, click the Save button below the search bar.