Our solution
Native Go pprof, one environment variable away
Cosmo Router integrates Go's standard pprof package. Set PPROF_ADDR and the full set of profiling endpoints becomes available: heap, CPU, goroutine, threadcreate, and block.
From symptom to root cause
Set PPROF_ADDR=:6060 to start the pprof HTTP server inside the router.
Capture profiles via curl: /debug/pprof/heap for memory, /debug/pprof/profile for CPU, /debug/pprof/goroutine for goroutines.
/debug/pprof/threadcreate and /debug/pprof/block cover thread creation and blocking operations.
CPU profiles run for 30 seconds by default; the duration is configurable via the seconds query parameter.
Run go tool pprof on the captured profile for flame graphs, top tables, and call trees in your browser.
When the endpoint is unset, there is no overhead; pprof is off entirely.
No instrumentation library. No SDK. Standard Go.

