Session replay and exploration
Session replay and exploration helps an engineer move from a browser session to the user actions and system events that explain it. The experience combines a session list, a correlated trace timeline, a side panel, and a DOM replay so that one session record can lead to deeper log, trace, and metric investigation.
Session exploration
Session records
The session page presents one record for each discovered browser session. Each record groups a session ID with its service, user identity when available, event count, error count, start time, and last active time. The list is ordered by recent activity and supports a large result set through a virtual scrolling view.
The page uses a session source for replay data and its required correlated trace source for session summaries. A session source is a configured source with a traceSourceId; the trace source supplies the events that identify activity in the session. The page can resolve a session source from a URL value and selects the first enabled session source when no source is set.
References: packages/…/SessionsPage.tsx• L66-113 packages/…/SessionsPage.tsx• L115-224 packages/…/SessionsPage.tsx• L245-303 packages/…/types.ts• L2167-2178
Session filters
The search controls apply a time range and a query to the correlated trace source. This matters because the session filter describes the spans and events inside a session rather than only the rows in the replay table. The page resolves field suggestions against that trace source so the query language matches the data shown in the session event list.
The page applies the selected source, query, query language, and time range when the engineer runs a search. A source change submits the new source automatically after it resolves. Without an explicit query, the list favors sessions with user activity or recording data. With an explicit query, matching sessions can remain visible when their events do not meet the default activity checks. Results are capped and sorted by the latest event.
References: packages/…/SessionsPage.tsx• L245-340 packages/…/SessionsPage.tsx• L385-392 packages/…/SessionsPage.tsx• L445-467 packages/…/sessions.ts• L40-89 packages/…/sessions.ts• L91-173 packages/…/sessions.ts• L227-260 packages/…/sessions.spec.ts• L49-95
Session selection
Selecting a session opens its details without leaving the list. The selected session ID and its time window are kept in the URL, which makes the open session restorable and shareable. The page expands the selected window on both sides so that recording events near the first and last trace events are not cut off. The side panel opens when the selected ID still exists in the current result set.
The main relationship between the records is shown below. The trace source identifies and summarizes the session, while the session source supplies the browser recording used by the player.
This diagram shows how a time-bounded query becomes a session card and then a combined event and replay view.
flowchart LR
Q[Time range and trace query] --> T[Correlated trace source]
S[Session source] --> R[Session record]
T --> R
R --> C[Session card]
C --> P[Session side panel]
P --> E[Trace event timeline]
P --> D[DOM replay]
E --> X[Event detail and trace context]
References: packages/…/SessionsPage.tsx• L342-424 packages/…/SessionSidePanel.tsx• L73-116 packages/…/SessionSubpanel.tsx• L231-253
Correlation model
Session and trace records
The session ID is the shared key between the browser recording and the correlated trace data. The trace query reads rum.sessionId from resource attributes, groups its results by service and session ID, and derives counts and time bounds. The replay query uses the same session ID together with the service name to retrieve recording events.
The session source configuration does not replace the trace source. It points to the trace source that gives the session its activity summary and event context. A missing or incorrect link breaks the path from a session card to its timeline.
References: packages/…/sessions.ts• L91-173 packages/…/sessions.ts• L177-224 packages/…/sessions.ts• L378-419 packages/…/types.ts• L2167-2178
Replay event records
The session table stores recording payloads as rows with a timestamp, service name, resource attributes, and log attributes. The standard hyperdx_sessions shape uses Body for the payload and attributes for the session ID. The source validation accepts the current timestamp form and the JSON-compatible timestamp form.
Recording payloads may be split across rows. The replay query orders rows by event time and recorder sequence data so that the stream has a stable order. The replay stream then buffers and joins the chunks by event and chunk identity before it sends complete event objects to the player. Malformed, duplicate, overflowing, or incomplete events are dropped and reported instead of silently corrupting the browser view.
References: packages/…/source.ts• L46-57 packages/…/source.ts• L871-895 packages/…/sessions.ts• L317-395 packages/…/rrwebChunkAssembler.ts• L1-21 packages/…/rrwebChunkAssembler.ts• L64-165 docker/…/00004_hyperdx_sessions.sql• L2-34
Log, trace, and metric links
The session flow uses trace data as its direct correlation layer. Trace sources can also reference a log source, a session source, and a metric source. Log sources can point to trace and metric sources. These links let an engineer move from a session event to a trace or related telemetry view without treating all data as one timeline.
The session event list itself is built from trace rows. It groups common browser signals into navigation, network, chat, custom action, and log-like events. An event can then open the shared row detail view, where trace context and other linked views can be explored.
References: packages/…/types.ts• L2076-2100 packages/…/types.ts• L2122-2165 packages/…/SessionEventList.tsx• L25-43 packages/…/SessionEventList.tsx• L118-213 packages/…/DBRowSidePanel.tsx• L533-564
Session timeline and playback
Event timeline
The event timeline gives a time-ordered view of the trace activity associated with the session. It has a highlighted view for key user-facing signals and an all-events view for broader investigation. The list marks errors and successful network responses, shows useful descriptions, and lets the engineer jump to an event time or open its row details.
The timeline and player share one focus time. Selecting a timestamp moves the player, and player progress can move the timeline to the matching event. The engineer can disable this follow behavior when browsing the list independently.
References: packages/…/SessionSubpanel.tsx• L143-211 packages/…/SessionSubpanel.tsx• L327-381 packages/…/SessionSubpanel.tsx• L430-509 packages/…/SessionEventList.tsx• L227-243
DOM playback
The DOM player reconstructs the recorded browser view from replay events. It loads the recording as a stream, starts after enough initial events are available, and adds later events as they arrive. A separate stream assembler keeps chunked events complete and prevents a replaced session stream from changing the active replay. The player reports its current time back to the timeline, which keeps playback and event investigation aligned.
Playback supports pause and play, speed changes, skipping idle time, fifteen-second navigation, full-width viewing, and the current page URL when the recording provides one. A session can have trace activity without a usable recording, so the player has a separate empty-replay state. If some recording events cannot be decoded, the player warns that the replay may be incomplete.
This diagram shows the playback path from stored chunks to an interactive browser view.
sequenceDiagram
participant P as DOM player
participant H as Session source
participant A as Chunk assembler
participant R as Replay engine
participant E as Event timeline
P->>H: Request recording chunks for service, session, and time window
H-->>P: Stream ordered chunks
P->>A: Pass recording rows
A-->>P: Emit complete replay events
P->>R: Load initial events
R-->>P: Render browser state and playback time
P-->>E: Update focused timestamp
E-->>P: Send selected event time
References: packages/…/DOMPlayer.tsx• L103-161 packages/…/DOMPlayer.tsx• L194-299 packages/…/DOMPlayer.tsx• L424-562 packages/…/sessions.ts• L317-395 packages/…/sessions.ts• L397-569 packages/…/rrwebChunkAssembler.ts• L23-165
Session side panel
Session panel
The session side panel keeps the session context visible while the engineer explores its timeline and replay. It shows the session label, recent activity, errors, event count, sharing controls, and the combined session subpanel. The panel can be resized or expanded to full width without hiding the rest of the application.
The panel owns the session-level close behavior. Outside clicks and Escape close it at the session root, while the list remains usable for selecting another session.
References: packages/…/SessionSidePanel.tsx• L118-169 packages/…/SessionSidePanel.tsx• L178-307 packages/…/SessionsPage.tsx• L226-228 packages/…/SessionsPage.tsx• L403-424
Event detail navigation
Clicking an event opens its detail view inside the existing session panel. The event view uses the trace source and can continue into trace or surrounding context views. It does not stack a second row panel over the session panel, so the session remains the parent context.
The selected event is tied to its session ID in URL state. This prevents a prior event selection from appearing inside a different session. Breadcrumbs and Escape provide a clear path back to the event list, while the session panel stays open until the engineer closes it.
References: packages/…/SessionSidePanel.tsx• L57-150 packages/…/SessionSidePanel.tsx• L215-245 packages/…/DBRowSidePanel.tsx• L599-612 packages/…/sessions.spec.ts• L98-179
Source setup
Session source
Session replay needs a source with the session kind and a valid session table. The source must expose the timestamp, resource attributes, event attributes, and replay body fields expected by the session flow. The setup view guides an operator to create this source, select hyperdx_sessions, choose its correlated trace source, and start browser recording.
The supplied hyperdx_sessions table stores OpenTelemetry-style records with a service name, timestamp, resource attributes, log attributes, and body. Its retention period controls how long replay data remains available.
References: packages/…/SessionsPage.tsx• L545-608 packages/…/source.ts• L46-57 packages/…/source.ts• L871-895 docker/…/00004_hyperdx_sessions.sql• L2-34
Correlated trace source
The session source must name a trace source because the trace source defines the session ID, service, event time, span identity, status, and event attributes used by the explorer. Its field mappings also supply the values needed for event search and detail views.
The correlation depends on consistent session IDs and compatible time ranges across both sources. If either source uses a different attribute or time expression, the session list and replay may describe different data even when both queries return rows.
References: packages/…/SessionTableModelForm.tsx• L16-95 packages/…/types.ts• L2122-2165 packages/…/sessions.ts• L91-173 packages/…/SessionSubpanel.tsx• L67-141
Related exploration pages
The parent page, Explorer and query experience, explains the shared query and exploration model. For adjacent investigations, use Search and log exploration, Trace investigation, and Metric exploration.
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the session source field contract aligned with replay chunk queries and the row shape accepted by
sessionRowSchema. - Keep the
rum.sessionIdand service-name mappings aligned between session summaries, event timelines, and DOM replay queries. - Keep the trace-source link in the session source aligned with the source used for search suggestions and event detail navigation.
- Keep replay ordering and chunk metadata aligned with the assembler contract so large events remain complete.
- Ensure replacement or unmount of a replay stream cannot deliver rows or completion state to the active player.
- When changing URL state for selected sessions or events, preserve the parent-child navigation rules for shared links and Escape behavior.
- When changing recording timestamps or retention, review the expanded replay window and the player range shown to users.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Session source lacks the required timestamp, attribute, or body fields | The source is rejected or replay queries cannot return usable rows | Validate the table against the supported session schema before use |
Session and trace sources use different rum.sessionId or service mappings | Cards, event timelines, and recordings refer to different sessions | Treat the trace link and shared session ID as one contract |
| Recording chunks arrive out of order or have duplicate or missing parts | A replay event is dropped and the browser view can be incomplete | Order rows with recorder sequence data and assemble chunks by event and chunk identity |
| A replay stream is replaced while its request still has pending delivery | Old events or completion state can pollute the new replay | Abort the old request and accept callbacks only from the active stream |
| Recording chunks are missing or no replay events exist | The timeline can still show activity, but the DOM player shows no replay | Keep trace exploration available and show the explicit empty-replay state |
| A selected event belongs to a prior session URL state | An event could open in the wrong session panel | Scope persisted event state by session ID before rendering |
| Replay data falls outside the requested time window | Playback starts late, ends early, or buffers at a selected event time | Query the expanded session window and update the player range from loaded events |
| The selected session is not in the current search results | The URL can contain a session selection without an open panel | Open the panel only for a result that matches the selected session ID |
Key files
| File | Why to read it |
|---|---|
| packages/…/SessionsPage.tsx | Shows source selection, trace-backed search, session cards, URL state, setup guidance, and the panel entry point. |
| packages/…/sessions.ts | Defines the relationship between session summaries, trace activity, recording rows, and replay streaming. |
| packages/…/SessionSidePanel.tsx | Explains session-level navigation, sharing, resizing, and event-to-detail transitions. |
| packages/…/SessionSubpanel.tsx | Connects the event timeline, focus time, playback controls, and DOM player. |
| packages/…/SessionEventList.tsx | Shows how trace rows become user-facing navigation, network, chat, custom, and error events. |
| packages/…/DOMPlayer.tsx | Shows how recorded browser events become an interactive replay and share a time cursor with the timeline. |
| packages/…/rrwebChunkAssembler.ts | Explains how split recording events become complete replay events and how bad chunks are reported. |
| packages/…/types.ts | Defines the source relationships that connect session, trace, log, and metric data. |
| docker/…/00004_hyperdx_sessions.sql | Describes the standard storage shape and retention boundary for replay records. |