manners
manners copied to clipboard
Allow /debug endpoints be access while service shutting down
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.
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