Documentation ¶
Overview ¶
Package pprof contains a helper to register pprof endpoints on a controller-runtime manager.
Index ¶
Constants ¶
View Source
const HTTPPrefixPProf = "/debug/pprof"
HTTPPrefixPProf is the prefix appended to all Endpoints.
Variables ¶
View Source
var Endpoints = map[string]http.Handler{ HTTPPrefixPProf + "/": http.HandlerFunc(pprof.Index), HTTPPrefixPProf + "/cmdline": http.HandlerFunc(pprof.Cmdline), HTTPPrefixPProf + "/profile": http.HandlerFunc(pprof.Profile), HTTPPrefixPProf + "/symbol": http.HandlerFunc(pprof.Symbol), HTTPPrefixPProf + "/trace": http.HandlerFunc(pprof.Trace), HTTPPrefixPProf + "/heap": pprof.Handler("heap"), HTTPPrefixPProf + "/goroutine": pprof.Handler("goroutine"), HTTPPrefixPProf + "/threadcreate": pprof.Handler("threadcreate"), HTTPPrefixPProf + "/block": pprof.Handler("block"), HTTPPrefixPProf + "/mutex": pprof.Handler("mutex"), }
Endpoints defines the debugging endpoints that are added by SetupHandlers.
Functions ¶
func GetHandlers ¶ added in v0.43.0
GetHandlers returns the pprof endpoints for the mgr metrics server.
The func can be used in the main.go file of your controller, when initializing the manager:
func main() { mgrConfig := ctrl.Options{ Metrics: metricsserver.Options{ BindAddress: metricsAddr, ExtraHandlers: pprof.GetHandlers(), }, } }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.