mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
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:
@@ -325,3 +325,57 @@ func loadDismissedHealthchecks(ctx context.Context, db database.Store, logger sl
|
||||
}
|
||||
return dismissedHealthchecks
|
||||
}
|
||||
|
||||
// @Summary Debug pprof index
|
||||
// @ID debug-pprof-index
|
||||
// @Security CoderSessionToken
|
||||
// @Success 200
|
||||
// @Tags Debug
|
||||
// @Router /debug/pprof [get]
|
||||
// @x-apidocgen {"skip": true}
|
||||
func _debugPprofIndex(http.ResponseWriter, *http.Request) {} //nolint:unused
|
||||
|
||||
// @Summary Debug pprof cmdline
|
||||
// @ID debug-pprof-cmdline
|
||||
// @Security CoderSessionToken
|
||||
// @Success 200
|
||||
// @Tags Debug
|
||||
// @Router /debug/pprof/cmdline [get]
|
||||
// @x-apidocgen {"skip": true}
|
||||
func _debugPprofCmdline(http.ResponseWriter, *http.Request) {} //nolint:unused
|
||||
|
||||
// @Summary Debug pprof profile
|
||||
// @ID debug-pprof-profile
|
||||
// @Security CoderSessionToken
|
||||
// @Success 200
|
||||
// @Tags Debug
|
||||
// @Router /debug/pprof/profile [get]
|
||||
// @x-apidocgen {"skip": true}
|
||||
func _debugPprofProfile(http.ResponseWriter, *http.Request) {} //nolint:unused
|
||||
|
||||
// @Summary Debug pprof symbol
|
||||
// @ID debug-pprof-symbol
|
||||
// @Security CoderSessionToken
|
||||
// @Success 200
|
||||
// @Tags Debug
|
||||
// @Router /debug/pprof/symbol [get]
|
||||
// @x-apidocgen {"skip": true}
|
||||
func _debugPprofSymbol(http.ResponseWriter, *http.Request) {} //nolint:unused
|
||||
|
||||
// @Summary Debug pprof trace
|
||||
// @ID debug-pprof-trace
|
||||
// @Security CoderSessionToken
|
||||
// @Success 200
|
||||
// @Tags Debug
|
||||
// @Router /debug/pprof/trace [get]
|
||||
// @x-apidocgen {"skip": true}
|
||||
func _debugPprofTrace(http.ResponseWriter, *http.Request) {} //nolint:unused
|
||||
|
||||
// @Summary Debug metrics
|
||||
// @ID debug-metrics
|
||||
// @Security CoderSessionToken
|
||||
// @Success 200
|
||||
// @Tags Debug
|
||||
// @Router /debug/metrics [get]
|
||||
// @x-apidocgen {"skip": true}
|
||||
func _debugMetrics(http.ResponseWriter, *http.Request) {} //nolint:unused
|
||||
|
||||
Reference in New Issue
Block a user