@@ -3,6 +3,8 @@ package support
3
3
import (
4
4
"context"
5
5
"encoding/json"
6
+ "io"
7
+ "net/http"
6
8
"strings"
7
9
8
10
"golang.org/x/xerrors"
@@ -19,11 +21,12 @@ import (
19
21
// Even though we do attempt to sanitize data, it may still contain
20
22
// sensitive information and should thus be treated as secret.
21
23
type Bundle struct {
22
- DeploymentInfo DeploymentInfo `json:"deployment_info"`
23
- WorkspaceInfo * WorkspaceInfo `json:"workspace_info"`
24
- NetcheckLocal * codersdk.WorkspaceAgentConnectionInfo `json:"netcheck_local"`
25
- NetcheckRemote * codersdk.WorkspaceAgentConnectionInfo `json:"netcheck_remote"`
26
- Logs []string `json:"logs"`
24
+ DeploymentInfo DeploymentInfo `json:"deployment_info"`
25
+ WorkspaceInfo * WorkspaceInfo `json:"workspace_info"`
26
+ NetcheckLocal * codersdk.WorkspaceAgentConnectionInfo `json:"netcheck_local"`
27
+ NetcheckRemote * codersdk.WorkspaceAgentConnectionInfo `json:"netcheck_remote"`
28
+ CoordinatorDebug string `json:"coordinator_debug"`
29
+ Logs []string `json:"logs"`
27
30
}
28
31
29
32
type DeploymentInfo struct {
@@ -121,6 +124,18 @@ func Run(ctx context.Context, d *Deps) (*Bundle, error) {
121
124
}
122
125
123
126
// Get /api/v2/debug/coordinator
127
+ coordResp ,err := d .Client .Request (ctx ,http .MethodGet ,"/api/v2/debug/coordinator" ,nil )
128
+ if err != nil {
129
+ d .Log .Error (ctx ,"fetch coordinator debug page" ,slog .Error (err ))
130
+ }else {
131
+ defer coordResp .Body .Close ()
132
+ coordBytes ,err := io .ReadAll (coordResp .Body )
133
+ if err != nil {
134
+ d .Log .Error (ctx ,"read coordinator debug page" ,slog .Error (err ))
135
+ }else {
136
+ b .CoordinatorDebug = string (coordBytes )
137
+ }
138
+ }
124
139
125
140
// Below checks require a workspace and agent
126
141
if d .WorkspaceID == uuid .Nil {