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 module 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
With Troubleshooting Details encrypted, all you can see are the Header and Body element keys that have been defined in the collection rule of the selected error. However, all values appear masked (blurred) and need to be decrypted in order to display. Follow the steps to decrypt below:
1. Click the "Decrypt" button.
Note, you can also find the "Decrypt" button by hovering and clicking the key icon within the query parameters, headers, and body elements.
2. Enter your private key and select "Decrypt".
3. You can now view the exposed error details.
Note, once decrypted if you see the message "Not collected" this means that the element is not present for the selected API error.
4. Click "Mask encrypted details" to re-apply the encryption.
Analyze in Impact and Error Analysis
You can continue your analysis in Impact and Error Analysis directly from the Troubleshoot screen:
- API error: quantify or see or the selected error in Error Analysis directly from the troubleshooting panel, or from the replay event stream or timeline.
-
Response body element: quantify a specific response body element for analysis:
Hover over, or select/highlight JSON from the Body in the Response tab and select the ‘Quantify’ button to be redirected to Impact.
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 “with 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 modules (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.