Fix pprof paths
@@ -88,18 +88,19 @@ func InstallRoutes(r *mux.Router, sdkRouter *sdkrouter.Router, opts *RoutesOptio
internalRouter.Handle("/metrics", promhttp.Handler())
if opts.EnableProfiling {
- internalRouter.HandleFunc("/symbol", pprof.Symbol).Methods(http.MethodPost)
- internalRouter.HandleFunc("/", pprof.Index)
- internalRouter.HandleFunc("/cmdline", pprof.Cmdline)
- internalRouter.HandleFunc("/profile", pprof.Profile)
- internalRouter.HandleFunc("/symbol", pprof.Symbol)
- internalRouter.HandleFunc("/trace", pprof.Trace)
- internalRouter.Handle("/allocs", pprof.Handler("allocs"))
- internalRouter.Handle("/block", pprof.Handler("block"))
- internalRouter.Handle("/goroutine", pprof.Handler("goroutine"))
- internalRouter.Handle("/heap", pprof.Handler("heap"))
- internalRouter.Handle("/mutex", pprof.Handler("mutex"))
- internalRouter.Handle("/threadcreate", pprof.Handler("threadcreate"))
+ pr := internalRouter.PathPrefix("/pprof").Subrouter()
+ pr.HandleFunc("/symbol", pprof.Symbol).Methods(http.MethodPost)
+ pr.HandleFunc("/", pprof.Index)
+ pr.HandleFunc("/cmdline", pprof.Cmdline)
+ pr.HandleFunc("/profile", pprof.Profile)
+ pr.HandleFunc("/symbol", pprof.Symbol)
+ pr.HandleFunc("/trace", pprof.Trace)
+ pr.Handle("/allocs", pprof.Handler("allocs"))
+ pr.Handle("/block", pprof.Handler("block"))
+ pr.Handle("/goroutine", pprof.Handler("goroutine"))
+ pr.Handle("/heap", pprof.Handler("heap"))
+ pr.Handle("/mutex", pprof.Handler("mutex"))
+ pr.Handle("/threadcreate", pprof.Handler("threadcreate"))
}
v2Router := r.PathPrefix("/api/v2").Subrouter()
