add some docs for telemetry server

move pprof to the telemetry server only
This commit is contained in:
Nicola Murino
2020-12-18 09:47:22 +01:00
parent 6d895843dc
commit 143df87fee
10 changed files with 31 additions and 29 deletions

View File

@@ -19,7 +19,7 @@ func GetHTTPRouter() http.Handler {
return router
}
func initializeRouter(staticFilesPath string, enableProfiler, enableWebAdmin bool) {
func initializeRouter(staticFilesPath string, enableWebAdmin bool) {
router = chi.NewRouter()
router.Group(func(r chi.Router) {
@@ -34,12 +34,6 @@ func initializeRouter(staticFilesPath string, enableProfiler, enableWebAdmin boo
router.Use(logger.NewStructuredLogger(logger.GetLogger()))
router.Use(middleware.Recoverer)
if enableProfiler {
logger.InfoToConsole("enabling the built-in profiler")
logger.Info(logSender, "", "enabling the built-in profiler")
router.Mount(pprofBasePath, middleware.Profiler())
}
router.NotFound(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
sendAPIResponse(w, r, nil, "Not Found", http.StatusNotFound)
}))