Hi,
I am interested in running pprof tools with GRPC gateway. How can I do that without running a separate server just for pprof?
Thanks.
You can simply import _ "net/http/pprof" if you reuse http.DefaultServeMux.
examples/main.go shows a way to combine http.ServeMux with github.com/grpc-ecosystem/grpc-gateway/runtime.ServeMux. However, I should have reuse http.DefaultServeMux in this example instead of calling http.NewServeMux(). If you reuse, import _ "net/http/pprof" will take effect.
Thanks @yugui .
Good question. I have the same
Most helpful comment
You can simply import
_ "net/http/pprof"if you reusehttp.DefaultServeMux.examples/main.goshows a way to combinehttp.ServeMuxwithgithub.com/grpc-ecosystem/grpc-gateway/runtime.ServeMux. However, I should have reusehttp.DefaultServeMuxin this example instead of callinghttp.NewServeMux(). If you reuse,import _ "net/http/pprof"will take effect.