From a54621ae5be7e7cf3187e514b7761954f0624dfe Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Thu, 26 Oct 2023 15:08:04 +0800 Subject: [PATCH] api: fix cannot dump trace (#7255) (#7265) close tikv/pd#7253 api: fix cannot dump trace with dashboard Signed-off-by: nolouch Co-authored-by: nolouch Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com> --- 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 }