From 2a92525858bb677e179e353b704e9905abc3b461 Mon Sep 17 00:00:00 2001 From: nolouch Date: Wed, 25 Oct 2023 19:53:40 +0800 Subject: [PATCH] api: fix cannot dump trace Signed-off-by: nolouch --- server/util.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/util.go b/server/util.go index 654b424465e..f88d0146a7f 100644 --- a/server/util.go +++ b/server/util.go @@ -17,6 +17,7 @@ package server import ( "context" "net/http" + "net/http/pprof" "path/filepath" "strings" @@ -121,8 +122,13 @@ func combineBuilderServerHTTPService(ctx context.Context, svr *Server, serviceBu userHandlers[pathPrefix] = handler } } + apiService.UseHandler(router) userHandlers[pdAPIPrefix] = apiService + + // fix issue https://github.com/tikv/pd/issues/7253 + // FIXME: remove me after upgrade + userHandlers["/debug/pprof/trace"] = http.HandlerFunc(pprof.Trace) return userHandlers, nil }