A HAR (HTTP Archive) file is used to record network activity between your browser and a website. This file helps diagnose issues such as failed API requests, slow-loading resources, and unexpected errors in Coder. Below are the steps to collect a HAR file while on the Coder workspace detail page in Google Chrome or Microsoft Edge.
Step 1: Open Developer Tools
- Open Google Chrome or Microsoft Edge.
- Navigate to your Coder workspace detail page.
- Open Developer Tools using one of these methods:
-
Windows/Linux: Press
F12orCtrl + Shift + I -
Mac: Press
Command + Option + I - Alternatively, right-click anywhere on the page and select Inspect.
-
Windows/Linux: Press
Step 2: Enable HAR file exports with sensitive data (optional)
| NOTE | You might be asked to generate a HAR file with sensitive data. This is necessary for troubleshooting issues around session cookie exchange and browser's behavior with regard to third-party cookies. |
|---|
By default, most browsers redact or omit sensitive information—such as authorization headers, cookies, and POST bodies—when generating HAR files. To capture this data for debugging purposes, you must explicitly enable it in the browser’s developer tools.
- Click the gear icon ⚙️ in the tab bar. The DevTools Settings page opens focused on the Preferences tab.
- Under the Network section, ensure the following settings are enabled:
- Preserve log
- Record network log
- Allow to generate HAR with sensitive data (this allows cookies and authorization headers to be recorded).
| F.Y.I. | Enabling the Allow to generate HAR with sensitive data setting does not automatically cause the browser to produce HAR files with sensitive data, but rather, makes creating them an option that you can select from the Export button. |
|---|
Step 3: Navigate to the Network Tab
- In Developer Tools, click on the Network tab.
- If the Network tab is empty, refresh the page (
F5orCtrl + R/Cmd + Ron Mac). - Make sure the "Preserve log" checkbox is selected to retain network activity.
Step 4: Reproduce the Issue
- Start recording network activity by ensuring the red circle (record button) is active. If it is gray, click it to begin recording.
- Perform the action that causes the issue in Coder (e.g., loading workspace details, encountering an API error, etc.).
- Allow the network activity to fully capture the interactions.
Step 5: Save the HAR File
- Once the issue has been reproduced, click on the Export button
and select HAR (Sanitized)... or HAR (with sensitive data)... in the Network tab's toolbar to download the HAR file.
- Save the HAR file to your local system.
Step 6: Share the HAR File
- Before sharing, review the HAR file for any unexpected sensitive information such as authorization tokens or credentials.
- If needed, edit the HAR file using a text editor to remove confidential data.
- Send the HAR file to Coder Support for troubleshooting.
Important Notes
- HAR files can contain sensitive data, including authentication tokens and session details. Ensure no private information is exposed before sharing.
- Only collect HAR files when troubleshooting specific issues.
- If needed, you can use a HAR viewer, like the Google Admin Toolbox HAR analyzer to inspect a HAR file before sending.