Use API error Troubleshooting Details to help identify where the error occurred and how to fix it.
Once configured, you can:
- See the following types of additional API error details in the Event Stream of Session Replay:
- The HTTP headers of the request and the response
- The body (the data sent by the request or received in the response)
- The body elements (specific elements of the request/response body)
- The query parameters of the request endpoint (of the URL of the information you request for).
- Leverage unencrypted response body elements in Errors Dashboards & Alerts, Analysis Context and Error Analysis to monitor, identify and quantify errors based on response body content.
Accessing Troubleshooting Details
API error Troubleshooting Details can be accessed from the Session Replay player.
Easily shortcut to the player from an API error in:
- Error Analysis: navigate to the API error’s side panel or view the full details page
- Dashboards and Alerts: right-click on a chart (containing an API error metric)
Once on the replay:
- Locate the API Error from the event stream or the timeline.
- Click the "Troubleshoot" button.
Unencrypted details
All unencrypted details will be displayed already: headers and body elements from Request and Response (on their respective tabs).
Encrypted details
To view encrypted data (headers, body elements, entire bodies and query params):
1. Click the "Decrypt" button.
2. Enter your private key in any of the tabs and select "Decrypt".
3. You can now view the exposed error details.
4. Click "Mask encrypted details" to re-apply the encryption.
Using unencrypted response body element
In the analysis context
Where the error condition is available in Analysis Context you can filter data on sessions where users experienced an API error with a specific body element:
1. Select "Errors" condition.
2. Select "An API error" from the error dropdown.
3. Fill any parameter you need (page, status code, method, request URL).
4. Tick “Response Body element”.
5. Select the body element JSON Path from the list pulled from the configuration.
6. Select one of the operators:
- Exists: if you want to filter only on the presence of the JSON path
- Equals: if you want to filter on the exact value
- Contains: if you want to filter on values containing the text you input
7. Apply to save the body element parameter.
8. Apply the analysis context condition.
In Real Time Error Dashboards
Use body element as a filter
Unencrypted response body element can be used as a filter on any of the widget types (except for "Image") in the Real Time Error Dashboards:
1. Create or select a Real Time Error Dashboards.
2. Add a new widget or edit an existing one (ensure it includes the API error metric).
3. Filters section appears.
4. Under "Filters" click "+ Add filter".
5. Select “Error body element”.
6. Select one of the collected unencrypted response body element JSON Paths from the list (coming from the created rules).
7. Set a condition on the value using one of multiples operators, or keep it on “exists” if you want to create the rule on the presence of the JSON.
Group by body element in data table widget
In the data table widget for real time error dashboard, unencrypted response Body element can be used to group API errors per distinct values of a selected JSON Path:
1. Create or select a Real Time Error Dashboards.
2. Add a widget.
3. Select the "Data table" widget type.
4. Proceed as usual for the widget fields.
5. Make sure to select a metric based on an API error.
6. In the “Group by” field, select one of the collected unencrypted response body element JSON Paths from the list (coming from the created rules).
7. Create the widget.
You will now have a table of distinct values for a specific body element JSON path sorted in descending order to get the most impactful errors (per the image below).
Filter on body element value from table widget
If you want to analyze the sessions that have experienced an API error with a specific body element value, the easiest way to build this filter is by using the “Apply as a segment” shortcut from the Table widget listing the different values of a body element.
Once done, the Analysis context will be automatically filled with the value. Then it becomes easy to:
- Analyze this context in other capabilities (e.g. in Impact quantification) as it will be persisted.
- Save it as a segment so you can use it for a widget in a regular dashboard, or elsewhere.