fix(monitor,webconsole): enable app profiling (#22176)

This commit is contained in:
Zexi Li
2025-02-24 19:51:31 +08:00
committed by GitHub
parent 4a2e1cc26d
commit 4a4f529600
2 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -31,6 +31,7 @@ import (
"yunion.io/x/onecloud/pkg/cloudcommon/db/taskman"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
"yunion.io/x/onecloud/pkg/monitor/models"
"yunion.io/x/onecloud/pkg/monitor/options"
)
func InitHandlers(app *appsrv.Application) {
@@ -134,5 +135,7 @@ func addMiscHandlers(app *appsrv.Application, root *mux.Router) {
root.HandleFunc("/worker_stats", adapterF(appsrv.WorkerStatsHandler))
// pprof handler
root.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
if options.Options.EnableAppProfiling {
root.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
}
}
+3 -1
View File
@@ -141,5 +141,7 @@ func addMiscHandlers(app *appsrv.Application, root *mux.Router) {
root.HandleFunc("/worker_stats", adapterF(appsrv.WorkerStatsHandler))
// pprof handler
root.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
if o.Options.EnableAppProfiling {
root.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
}
}