pproflabels

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 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 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