diff --git a/pkg/server/server.go b/pkg/server/server.go index 495b601..1783cc9 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -20,11 +20,14 @@ func RunServer(ctx *cli.Context) error { ctx.WriteString("/metrics") }) r.GET("/metrics", prometheusHandler()) - r.GET("/debug/pprof/", pprofHandlerIndex) - r.GET("/debug/pprof/cmdline", pprofHandlerCmdline) - r.GET("/debug/pprof/profile", pprofHandlerIndex) - r.GET("/debug/pprof/trace", pprofHandlerTrace) - r.GET("/debug/pprof/{profile}", pprofHandlerIndex) + + if config.Debug { + r.GET("/debug/pprof/", pprofHandlerIndex) + r.GET("/debug/pprof/cmdline", pprofHandlerCmdline) + r.GET("/debug/pprof/profile", pprofHandlerIndex) + r.GET("/debug/pprof/trace", pprofHandlerTrace) + r.GET("/debug/pprof/{profile}", pprofHandlerIndex) + } log.Print("exporter listening on 0.0.0.0:" + strconv.Itoa(config.Port)) return fasthttp.ListenAndServe(":"+strconv.Itoa(config.Port), r.Handler)