diff --git a/core/web/router.go b/core/web/router.go index 62e74b926cd..5a412595e0c 100644 --- a/core/web/router.go +++ b/core/web/router.go @@ -35,7 +35,6 @@ import ( "go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin" "go.opentelemetry.io/otel" - "github.com/smartcontractkit/chainlink/v2/core/build" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/web/auth" @@ -178,7 +177,7 @@ func debugRoutes(app chainlink.Application, r *gin.RouterGroup) { group.GET("/vars", expvar.Handler()) } -func metricRoutes(r *gin.RouterGroup, includeHeap bool) { +func metricRoutes(r *gin.RouterGroup) { pprofGroup := r.Group("/debug/pprof") pprofGroup.GET("/", ginHandlerFromHTTP(pprof.Index)) pprofGroup.GET("/cmdline", ginHandlerFromHTTP(pprof.Cmdline)) @@ -189,10 +188,7 @@ func metricRoutes(r *gin.RouterGroup, includeHeap bool) { pprofGroup.GET("/allocs", ginHandlerFromHTTP(pprof.Handler("allocs").ServeHTTP)) pprofGroup.GET("/block", ginHandlerFromHTTP(pprof.Handler("block").ServeHTTP)) pprofGroup.GET("/goroutine", ginHandlerFromHTTP(pprof.Handler("goroutine").ServeHTTP)) - includeHeap = true - if includeHeap { - pprofGroup.GET("/heap", ginHandlerFromHTTP(pprof.Handler("heap").ServeHTTP)) - } + pprofGroup.GET("/heap", ginHandlerFromHTTP(pprof.Handler("heap").ServeHTTP)) pprofGroup.GET("/mutex", ginHandlerFromHTTP(pprof.Handler("mutex").ServeHTTP)) pprofGroup.GET("/threadcreate", ginHandlerFromHTTP(pprof.Handler("threadcreate").ServeHTTP)) } @@ -431,7 +427,7 @@ func v2Routes(app chainlink.Application, r *gin.RouterGroup) { authv2.GET("/build_info", buildInfo.Show) // Debug routes accessible via authentication - metricRoutes(authv2, build.IsDev()) + metricRoutes(authv2) } ping := PingController{app}