pproflabels

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

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