diff --git a/cmd/main.go b/cmd/main.go index e244516..409b141 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -21,7 +21,7 @@ func main() { logging.LogSetup(c.LogLevel) - if c.PprofEnabled { + if c.Metrics.GinMode != "release" { go func() { log.Println(http.ListenAndServe("localhost:6060", nil)) }() diff --git a/config.env b/config.env index 757bc25..b22e762 100644 --- a/config.env +++ b/config.env @@ -2,7 +2,6 @@ APP_LOG_LEVEL=error APP_NUMCPUS=-1 APP_CHECK_PERIOD=6 EXTERNAL_BROWSER= -PPROF_ENABLED=false GRPC_SERVER_HOST=0.0.0.0 GRPC_SERVER_PORT=9060 diff --git a/config/config.go b/config/config.go index 6b1ec59..f2ebaa4 100644 --- a/config/config.go +++ b/config/config.go @@ -7,7 +7,6 @@ import ( ) type Config struct { - PprofEnabled bool LogLevel string NumCPUs int CheckPeriod int @@ -47,7 +46,6 @@ type MetricsConfig struct { func NewConfig() *Config { return &Config{ - PprofEnabled: getEnvBool("PPROF_ENABLED", true), LogLevel: getEnv("APP_LOG_LEVEL", "debug"), NumCPUs: getEnvInt("APP_NUMCPUS", -1), CheckPeriod: getEnvInt("APP_CHECK_PERIOD", 6), diff --git a/pkg/router/handler.go b/pkg/router/handler.go index 5ede9de..ddd1b91 100644 --- a/pkg/router/handler.go +++ b/pkg/router/handler.go @@ -37,12 +37,6 @@ func NewHandler(deps Deps) *Handler { p := ginprometheus.NewPrometheus("gin") p.Use(engine) - engine.Use(gin.LoggerWithConfig(gin.LoggerConfig{ - Skip: func(c *gin.Context) bool { - return c.Request.URL.Path == "/metrics" - }, - })) - srv := http.Server{ Addr: deps.Addr, Handler: engine,