pprof

package
v0.110.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 3 Imported by: 23 modules, 24 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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