go
go copied to clipboard
net/http/pprof: documentation doesn't mention some available endpoints
Looking at https://pkg.go.dev/net/http/pprof as of Go 1.18.4, the following endpoints are documented:
- heap
- profile
- block
- mutex
- trace
From looking at https://cs.opensource.google/go/go/+/refs/tags/go1.18.4:src/net/http/pprof/pprof.go;l=344-354, the following are seemingly undocumented:
- allocs
- cmdline
- goroutine
- threadcreate
In particular, I think the goroutine
endpoint is critically underused; goroutine leaks are a fairly common source of problems in long-lived Go servers, and being able to obtain a goroutine stack dump via /debug/pprof/goroutine?debug=2
is invaluable. I've met a handful of people over the years who needed this and resorted to heavier alternatives like SIGQUIT because they weren't aware that net/http/pprof
had it.
cc @cherrymui @rsc per https://dev.golang.org/owners
dup of #27737 ?
Change https://go.dev/cl/421635 mentions this issue: net/http/pprof: link docs to runtime/pprof