feat: 添加pprof
This commit is contained in:
parent
4aa22bf346
commit
36b724b97b
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue