pprof

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package pprof serves Go profiles on a dedicated, opt-in listener.

It is OFF unless an address is configured, and the address it is meant to carry is a loopback one. Both choices are about what a heap dump contains: this agent's heap holds unredacted Secret values from the state watcher's informer cache and raw log lines from every collected pod. A profile endpoint is therefore an exfiltration path for exactly the data the agent exists to handle carefully, and it must not be reachable from the cluster network.

Binding 127.0.0.1 is what makes that true while keeping the endpoint usable: `kubectl port-forward` attaches to the pod's own network namespace, so an operator holding pods/portforward RBAC still reaches it and nothing else on the network does. For the same reason the chart neither publishes this port on the Service nor declares it as a containerPort -- both would advertise an exposure that is not intended.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server serves /debug/pprof on its own listener.

func NewServer

func NewServer(addr string, log *logger.Logger) *Server

NewServer returns a profile server bound to addr, or nil when addr is empty.

A nil Server is the disabled case and every method tolerates it, so callers wire it up unconditionally and the "off" path costs one nil check rather than a branch at every use.

func (*Server) Addr

func (s *Server) Addr() string

Addr reports the configured listen address, or "" when disabled.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run serves until ctx is cancelled, then shuts down gracefully. A nil Server returns immediately: profiling is off and that is not an error.

Jump to

Keyboard shortcuts

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