feat: mount pprof and metrics to /api/v2/debug for admins (#20353)

Adds the following debug routes for people with the `debug_info:read`
permission:
- `/api/v2/debug/pprof` for `net/http/pprof`
    - `/`
    - `/cmdline`
    - `/profile`
    - `/symbol`
    - `/trace`
    - `/*`
- `/api/v2/debug/metrics` for Prometheus metrics
This commit is contained in:
Dean Sheather
2025-10-21 03:13:11 +00:00
committed by GitHub
parent 5a18cf4c86
commit 0652b18ebc
5 changed files with 348 additions and 3 deletions
+3 -2
View File
@@ -160,8 +160,9 @@ func VerifySwaggerDefinitions(t *testing.T, router chi.Router, swaggerComments [
t.Run(method+" "+route, func(t *testing.T) {
t.Parallel()
// This route is for compatibility purposes and is not documented.
if route == "/workspaceagents/me/metadata" {
// Wildcard routes break the swaggo parser, so we do not document
// them.
if strings.HasSuffix(route, "/*") {
return
}