Help us shape the future of Go! Take the 2026 Go Developer Survey

pprof

package
v0.90.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 3 Imported by: 24

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

func GetHandlers() map[string]http.Handler

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL