Skip to content

Document agent debug endpoints #14362

Closed as not planned
Closed as not planned
@dannykopping

Description

@dannykopping

The agent has several HTTP endpoints which can be used for debugging. They are defined here:

coder/agent/agent.go

Lines 1799 to 1812 in 8c05651

func (a *agent) HTTPDebug() http.Handler {
r := chi.NewRouter()
r.Get("/debug/logs", a.HandleHTTPDebugLogs)
r.Get("/debug/magicsock", a.HandleHTTPDebugMagicsock)
r.Get("/debug/magicsock/debug-logging/{state}", a.HandleHTTPMagicsockDebugLoggingState)
r.Get("/debug/manifest", a.HandleHTTPDebugManifest)
r.NotFound(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
_, _ = w.Write([]byte("404 not found"))
})
return r
}

We should document that these exist, as well as how to call them. This should naturally also mention the config flag which controls the listening address:

coder/cli/agent.go

Lines 393 to 399 in e96652e

{
Flag: "debug-address",
Default: "127.0.0.1:2113",
Env: "CODER_AGENT_DEBUG_ADDRESS",
Value: serpent.StringOf(&debugAddress),
Description: "The bind address to serve a debug HTTP server.",
},
.

Metadata

Metadata

Labels

docsArea: coder.com/docs

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions