feat: 添加pprof

This commit is contained in:
wolter 2025-07-04 09:43:16 +08:00
parent 4aa22bf346
commit 36b724b97b
1 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import (
"PaymentCenter/app/http/trace"
"PaymentCenter/app/utils/metric"
"PaymentCenter/config"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/gin"
"github.com/qit-team/snow-core/http/middleware"
"github.com/qit-team/snow-core/log/logger"
@ -32,6 +33,9 @@ func RegisterRoute(router *gin.Engine) {
})
}
//pprof
pprof.Register(router, "/pay/pprof")
if len(config.GetConf().SkyWalkingOapServer) > 0 && config.IsEnvEqual(config.ProdEnv) {
err := trace.InitTracer(config.GetConf().ServiceName, config.GetConf().SkyWalkingOapServer)
if err != nil {