diff --git a/allsrv/cmd/allsrv/main.go b/allsrv/cmd/allsrv/main.go index ba74c36..72275e0 100644 --- a/allsrv/cmd/allsrv/main.go +++ b/allsrv/cmd/allsrv/main.go @@ -6,6 +6,7 @@ import ( "errors" "log/slog" "net/http" + "net/http/pprof" "os" "strings" "time" @@ -36,6 +37,13 @@ func main() { } mux := http.NewServeMux() + + // Register pprof handlers + mux.HandleFunc("/debug/pprof/", pprof.Index) + mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) + mux.HandleFunc("/debug/pprof/profile", pprof.Profile) + mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) + mux.HandleFunc("/debug/pprof/trace", pprof.Trace) selectedSVR := strings.TrimSpace(strings.ToLower(os.Getenv("ALLSRV_SERVER"))) if selectedSVR != "v2" {