Skip to main content
pprof is the built-in Go profiler used to inspect how the OpenTelemetry Collector behaves under load. It’s intended for deep performance debugging by collector developers or advanced operators, not for routine monitoring. This guide explains how to enable the pprof extension so the collector exposes live runtime profiles. To enable pprof on port 1777, add the following to your collector configuration:
pprof exposes low-level runtime profiles (CPU, heap, goroutines, mutex contention, etc.). Use it only when diagnosing performance issues or performing targeted profiling—do not leave it exposed in production without access controls.
Once enabled, the pprof endpoint provides several runtime profiles. The most commonly used profiles are:
  • CPU profile: shows where the collector spends processing time.
  • Heap / allocs profiles: reveal memory usage and growth.
  • Goroutine: lists active goroutines and helps detect leaks.
  • Mutex: shows lock contention points.
  • Block: shows where goroutines are blocked waiting (e.g., on network or synchronization).
You can also reference these in a quick lookup table:
ProfilePurposeEndpoint
CPUIdentify hot code paths consuming CPU/debug/pprof/profile?seconds=<n>
Heap / allocsInspect heap allocations and growth/debug/pprof/heap
GoroutineList active goroutines and stack traces/debug/pprof/goroutine?debug=1
MutexFind lock contention hotspots/debug/pprof/mutex
BlockShow blocking profile (contention/waits)/debug/pprof/block
The pprof web UI is available at http://<host>:1777/debug/pprof and lists all available profiles for download and inspection.
The image shows a webpage displaying Go performance profiling information with "pprof" on port 1777. It lists types of profiles available, such as "allocs" and "goroutine," along with their counts and descriptions.
Downloading profiles for offline analysis
  • Record a 30-second CPU profile from a local collector:
  • Download other useful profiles:
Replace localhost with the collector host or IP where needed (for example, http://my-collector-host:1777/debug/pprof/...). Analyzing profiles with the Go pprof tool A common interactive workflow uses the go tool pprof visualizer:
The pprof visualizer supports flame graphs, callgraphs, and textual reports. Flame graphs are particularly useful to quickly identify hot call paths—wider blocks represent functions that consume more CPU time.
The image shows a visualization of profiling results, likely from the pprof tool, with a colorful flame graph depicting function calls and execution paths. It includes various labeled sections like "runtime", "net/http", and "go.opentelemetry.io".
Interpreting flame graphs and call stacks
  • Start from the wide blocks (hot functions) and trace downward to leaf functions to understand where time is spent.
  • Look for heavy usage in components such as the batch processor, exporters, or custom receivers/processors.
  • Use heap and allocs data to correlate CPU activity with memory growth; goroutine and mutex profiles often reveal synchronization bottlenecks or leaks.
  • Prioritize optimization on code paths that are both high-cost and frequently executed.
pprof endpoints can expose detailed runtime and stack information. Do not expose them to untrusted networks—restrict access with network controls (firewalls, port binding), or secure access methods (SSH tunnels, VPNs).
Links and references This covers enabling pprof in the OpenTelemetry Collector, collecting runtime profiles, and basic analysis workflows to find CPU, memory, and concurrency issues.

Watch Video