Documentation
¶
Overview ¶
Package pproflabels attaches pprof labels to goroutines so that profiles and goroutine dumps remain attributable to the controller and logical cluster that own them. Labels propagate to goroutines started during the labeled call, so wrapping the outermost per-cluster goroutine is enough.
Index ¶
Constants ¶
View Source
const ( LabelController = "controller" LabelLogicalCluster = "logicalcluster" )
Label keys. Kept stable so tooling (pprof filters, leak tests) can match on them.
Variables ¶
This section is empty.
Functions ¶
func Cluster ¶
func Cluster(ctx context.Context, controller string, cluster logicalcluster.Name, fn func(context.Context))
Cluster runs fn with pprof labels identifying the controller and logical cluster. Wrap per-cluster goroutine starts with this so leaked goroutines stay attributable in /debug/pprof/goroutine?debug=2 dumps and in goleak output. See https://github.com/kcp-dev/kcp/issues/4071.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.