open-match
open-match copied to clipboard
zpages pprof seems to be unaccessable due to router problem
func bindZpages(p Params, b Bindings) error {
if !p.Config().GetBool(configNameTelemetryZpagesEnabled) {
logger.Info("zPages: Disabled")
return nil
}
logger.WithFields(logrus.Fields{
"endpoint": debugEndpoint,
}).Info("zPages: ENABLED")
mux := http.NewServeMux()
zpages.Handle(mux, debugEndpoint)
mux.HandleFunc(debugEndpoint+"/pprof/", pprof.Index)
mux.HandleFunc(debugEndpoint+"/pprof/cmdline", pprof.Cmdline)
mux.HandleFunc(debugEndpoint+"/pprof/profile", pprof.Profile)
mux.HandleFunc(debugEndpoint+"/pprof/symbol", pprof.Symbol)
mux.HandleFunc(debugEndpoint+"/pprof/trace", pprof.Trace)
b.TelemetryHandle(debugEndpoint, mux)
return nil
}
When http.ServerMux is as the handler of another ServerMux, the top path expect a / in the end of path. So b.TelemetryHandle(debugEndpoint, mux) should be b.TelemetryHandle(debugEndpoint+"/", mux)