manners icon indicating copy to clipboard operation
manners copied to clipboard

Allow /debug endpoints be access while service shutting down

Open viblo opened this issue 9 years ago • 1 comments

Sometimes if the service is left hanging waiting for shutdown you want to access the /debug endpoints provided by some packages, such as the one you get by importing /net/http/pprof

Any idea on how to handle such a scenario? Ideally I wouldnt want to assign two port to all my go services.

viblo avatar Mar 04 '16 10:03 viblo

In case someone is reading this issue: I settled on exposing the http.DefaultServeMux as a unix domain socket as a work around. I used this code as a inspiration https://github.com/betfair/opentsp/blob/master/internal/pprof/pprof_unix.go

viblo avatar Apr 01 '16 04:04 viblo