Replaying user sessions isn’t just about watching a video; it’s about stepping into the user’s shoes to understand their digital journey, especially when things go wrong.
Let’s see it in action. Imagine a user, "Alice," is trying to complete a purchase on your e-commerce site.
Alice lands on the homepage. Dynatrace RUM injects a JavaScript agent that starts capturing her interactions. As she navigates, clicks buttons, and fills out forms, the agent records every network request, every DOM change, every JavaScript error, and even the device’s network conditions.
Here’s a snippet of what that captured data might look like conceptually (in reality, it’s much more detailed and stored in a time-series database):
{
"timestamp": "2023-10-27T10:30:05Z",
"eventType": "pageLoad",
"url": "https://your-ecommerce.com/",
"domContentLoadedTime": 1250,
"fullyLoadedTime": 2800,
"device": {"type": "mobile", "os": "iOS 15.7"},
"network": {"type": "wifi", "speed": "fast"}
}
Alice then navigates to a product page.
{
"timestamp": "2023-10-27T10:30:12Z",
"eventType": "click",
"elementId": "product-link-123",
"elementTag": "a",
"textContent": "Awesome Gadget Pro"
}
She adds it to her cart.
{
"timestamp": "2023-10-27T10:30:20Z",
"eventType": "ajaxRequest",
"url": "/api/cart/add",
"method": "POST",
"requestPayloadSize": 150,
"response": {"status": 200, "size": 50},
"duration": 350
}
Finally, she proceeds to checkout. During the payment step, she encounters an issue. The JavaScript agent captures this as well.
{
"timestamp": "2023-10-27T10:31:05Z",
"eventType": "javascriptError",
"errorMessage": "TypeError: Cannot read properties of undefined (reading 'apply')",
"stackTrace": "at PaymentForm.submit (https://your-ecommerce.com/js/payment.bundle.js:123:45)"
}
This sequence of captured events forms Alice’s session. Dynatrace RUM reconstructs this session data, allowing you to replay it. You see her exact path, the elements she interacted with, and crucially, where and why she experienced a problem.
The problem this solves is the "it works on my machine" syndrome. Developers and operations teams often struggle to reproduce user-reported issues because they lack the context of the user’s environment, their specific actions, and the ephemeral nature of client-side problems. RUM replay provides this context.
Internally, Dynatrace’s RUM agent is a sophisticated piece of JavaScript that runs in the user’s browser. It leverages the browser’s Performance API, MutationObserver, and event listeners to capture a comprehensive set of user interactions and performance metrics. This data is then batched and sent to the Dynatrace backend. The backend correlates these events into user sessions, linking them to the specific application version, user segment, and even the underlying infrastructure.
The exact levers you control are primarily through the Dynatrace RUM configuration. You can define:
- Capture Rate: How many user sessions to analyze (e.g., 10% of all sessions, or 100% for a specific application).
- Session Properties: What attributes to associate with each session (e.g., user ID, customer tier, product viewed) for better filtering and analysis.
- Resource Timing: Whether to capture detailed timing for all resources or just critical ones.
- JavaScript Error Capture: To enable or disable the capture of client-side JavaScript errors.
- User Action Granularity: How detailed the capture of user interactions should be (e.g., capturing every click vs. only major navigation events).
When you’re looking at a specific user session replay, the most impactful data is often not just the frontend error, but the correlated backend transaction. The replay will show you the failed frontend action, and by clicking through, you can see the corresponding backend request that either timed out, returned an error (like a 500), or was significantly slow. This immediately tells you whether the problem originated in the browser or on the server, guiding your investigation.
After mastering session replays, you’ll naturally want to automate the detection of these problematic sessions using Dynatrace’s AI capabilities.