From d4b056fd3271600d7098c100e21954bb298d9858 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Sat, 12 Oct 2024 20:23:13 +0800 Subject: [PATCH] fix: add debug router --- web/new.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/new.go b/web/new.go index c532821fb..c229bf6ef 100644 --- a/web/new.go +++ b/web/new.go @@ -19,6 +19,7 @@ import ( "fmt" "net" "net/http" + "net/http/pprof" "strconv" "strings" "time" @@ -107,6 +108,11 @@ func New() *echo.Echo { app.Use(recovery.New()) app.GET("/metrics", echo.WrapHandler(promhttp.Handler())) + app.GET("/debug/pprof/cmdline", echo.WrapHandler(http.HandlerFunc(pprof.Cmdline))) + app.GET("/debug/pprof/profile", echo.WrapHandler(http.HandlerFunc(pprof.Profile))) + app.GET("/debug/pprof/symbol", echo.WrapHandler(http.HandlerFunc(pprof.Symbol))) + app.GET("/debug/pprof/trace", echo.WrapHandler(http.HandlerFunc(pprof.Trace))) + app.GET("/debug/pprof/*", echo.WrapHandler(http.HandlerFunc(pprof.Index))) addProfile(app)