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 SetupHandlers ¶
SetupHandlers registers the pprof endpoints on the metrics server of the given mgr.
The func can be used in the main.go file of your controller, after initialisation of the manager:
func main() { mgr, err := ctrl.NewManager(cfg, ctrl.Options{}) if err != nil { log.Error(err, "unable to start manager") os.Exit(1) } pprof.SetupHandlers(mgr, log) }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.