go icon indicating copy to clipboard operation
go copied to clipboard

net/http/pprof: documentation doesn't mention some available endpoints

Open mvdan opened this issue 1 year ago • 2 comments

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

mvdan avatar Jul 20 '22 12:07 mvdan

dup of #27737 ?

seankhliao avatar Aug 03 '22 20:08 seankhliao

Change https://go.dev/cl/421635 mentions this issue: net/http/pprof: link docs to runtime/pprof

gopherbot avatar Aug 06 '22 12:08 gopherbot