diff --git a/internal/api/router/manager.go b/internal/api/router/manager.go index cd29911..57d36ea 100644 --- a/internal/api/router/manager.go +++ b/internal/api/router/manager.go @@ -77,6 +77,16 @@ func (m *Manager) ListenAndServe(ctx context.Context, address string, port int, mux.HandleFunc("GET /debug/pprof/symbol", pprof.Symbol) } + if enablepprof { + router.HandlerFunc(http.MethodGet, "/debug/pprof/", pprof.Index) + router.HandlerFunc(http.MethodGet, "/debug/pprof/allocs", pprof.Index) + router.HandlerFunc(http.MethodGet, "/debug/pprof/goroutine", pprof.Index) + router.HandlerFunc(http.MethodGet, "/debug/pprof/heap", pprof.Index) + router.HandlerFunc(http.MethodGet, "/debug/pprof/profile", pprof.Profile) + router.HandlerFunc(http.MethodGet, "/debug/pprof/trace", pprof.Trace) + router.HandlerFunc(http.MethodGet, "/debug/pprof/symbol", pprof.Symbol) + } + listenSocket := fmt.Sprint(address, ":", port) log.Info().Msgf("Start webserver - listening on %s", listenSocket) diff --git a/internal/config/settings.go b/internal/config/settings.go index b2c6657..afea355 100644 --- a/internal/config/settings.go +++ b/internal/config/settings.go @@ -41,6 +41,11 @@ type Config struct { Level string Pretty bool } + Debug struct { + Pprof struct { + Enabled bool + } + } Datacenter string API struct { ListenAddress string