Skip to content

Document agent debug endpoints #14362

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

Closed
dannykopping opened this issue Aug 20, 2024 · 4 comments
Closed

Document agent debug endpoints #14362

dannykopping opened this issue Aug 20, 2024 · 4 comments
Assignees
Labels
docs Area: coder.com/docs

Comments

@dannykopping
Copy link
Contributor

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.",
},
.

@johnstcn
Copy link
Member

@DanielleMaywood can this be closed out?

@DanielleMaywood
Copy link
Contributor

@DanielleMaywood can this be closed out?

@johnstcn It was decided to handwrite the documentation instead of using swagger to automatically generate them, which is (if I am remembering correctly) why I hadn't closed this issue.

I'm happy to close this out if we decide that using swagger to automatically generate them instead should be a separate issue.

@matifali
Copy link
Member

matifali commented Jan 28, 2025

Don't we have it now at https://coder.com/docs/reference/agent-api/debug?

@DanielleMaywood @dannykopping, do we want to document something else, too?

@EdwardAngert
Copy link
Contributor

closed as not planned for now

@EdwardAngert EdwardAngert closed this as not planned Won't fix, can't repro, duplicate, stale Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Area: coder.com/docs
Projects
None yet
Development

No branches or pull requests

5 participants