diff --git a/api/debug.go b/api/debug.go index 6ed0f8fa9..53cc1ccf8 100644 --- a/api/debug.go +++ b/api/debug.go @@ -4,6 +4,7 @@ import ( "expvar" "fmt" "net/http" + "net/http/pprof" "runtime" "github.com/containous/mux" @@ -36,4 +37,10 @@ func (g DebugHandler) AddRoutes(router *mux.Router) { }) fmt.Fprint(w, "\n}\n") }) + + router.Methods(http.MethodGet).PathPrefix("/debug/pprof/").HandlerFunc(pprof.Index) + router.Methods(http.MethodGet).PathPrefix("/debug/pprof/cmdline").HandlerFunc(pprof.Cmdline) + router.Methods(http.MethodGet).PathPrefix("/debug/pprof/profile").HandlerFunc(pprof.Profile) + router.Methods(http.MethodGet).PathPrefix("/debug/pprof/symbol").HandlerFunc(pprof.Symbol) + router.Methods(http.MethodGet).PathPrefix("/debug/pprof/trace").HandlerFunc(pprof.Trace) } diff --git a/docs/configuration/api.md b/docs/configuration/api.md index 60b608b7e..8c89644bf 100644 --- a/docs/configuration/api.md +++ b/docs/configuration/api.md @@ -17,7 +17,10 @@ # dashboard = true - # Enabled debug mode + # Enable debug mode. + # This will install HTTP handlers to expose Go expvars under /debug/vars and + # pprof profiling data under /debug/pprof. + # Additionally, the log level will be set to DEBUG. # # Optional # Default: false diff --git a/docs/configuration/commons.md b/docs/configuration/commons.md index e4252f913..69e167e86 100644 --- a/docs/configuration/commons.md +++ b/docs/configuration/commons.md @@ -17,6 +17,9 @@ # graceTimeOut = "10s" # Enable debug mode. +# This will install HTTP handlers to expose Go expvars under /debug/vars and +# pprof profiling data under /debug/pprof. +# Additionally, the log level will be set to DEBUG. # # Optional # Default: false