Skip to content

chore(docs): document agent api debug endpoints #14454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore(docs): add high level overview of agent api debug docs
  • Loading branch information
DanielleMaywood committed Aug 27, 2024
commit 02643881a6ec84dd473b0b061bc25412b7e989cd
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ func (a *agent) HandleHTTPDebugLogs(w http.ResponseWriter, r *http.Request) {
}
defer f.Close()

// Limit to 10MB.
// Limit to 10MiB.
w.WriteHeader(http.StatusOK)
_, err = io.Copy(w, io.LimitReader(f, 10*1024*1024))
if err != nil && !errors.Is(err, io.EOF) {
Expand Down
13 changes: 9 additions & 4 deletions docs/reference/agent-api/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ curl http://127.0.0.1:2113/debug/logs

`GET /debug/logs`

Get the first 10MiB of data from `$CODER_AGENT_LOG_DIR/coder-agent.log`.

### Responses

| Status | Meaning | Description | Schema |
Expand All @@ -26,11 +28,8 @@ curl http://127.0.0.1:2113/debug/magicsock

`GET /debug/magicsock`

### Responses

See
[Tailscale's documentation](https://pkg.go.dev/tailscale.com/wgengine/magicsock#Conn.ServeHTTPDebug)
for response format.
[Tailscale's documentation](https://pkg.go.dev/tailscale.com/wgengine/magicsock#Conn.ServeHTTPDebug).

## Toggle debug logging for magicsock

Expand All @@ -42,6 +41,10 @@ curl http://127.0.0.1:2113/debug/magicsock/debug-logging/true

`GET /debug/magicsock/debug-logging/{state}`

Set whether debug logging is enabled. See
[Tailscale's documentation](https://pkg.go.dev/tailscale.com/wgengine/magicsock#Conn.SetDebugLoggingEnabled)
for more information.

### Parameters

| Name | In | Type | Required | Description |
Expand All @@ -64,6 +67,8 @@ curl http://127.0.0.1:2113/debug/manifest

`GET /debug/manifest`

Get the manifest the agent fetched from `coderd` upon startup.

### Responses

| Status | Meaning | Description | Schema |
Expand Down