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.
- 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).
| Profile | Purpose | Endpoint |
|---|---|---|
| CPU | Identify hot code paths consuming CPU | /debug/pprof/profile?seconds=<n> |
| Heap / allocs | Inspect heap allocations and growth | /debug/pprof/heap |
| Goroutine | List active goroutines and stack traces | /debug/pprof/goroutine?debug=1 |
| Mutex | Find lock contention hotspots | /debug/pprof/mutex |
| Block | Show blocking profile (contention/waits) | /debug/pprof/block |
http://<host>:1777/debug/pprof and lists all available profiles for download and inspection.

- Record a 30-second CPU profile from a local collector:
- Download other useful profiles:
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:

- 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).
- Go pprof documentation: https://pkg.go.dev/net/http/pprof
- go tool pprof: https://github.com/google/pprof
- OpenTelemetry Collector repo: https://github.com/open-telemetry/opentelemetry-collector