Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 26cf26d

Browse files
authored
Pprof endpoint (#1474)
Fix two issues: - We want to expose goroutine stack traces endpoint too - Protect pprof using authentication to prevent security issues
1 parent 135fadc commit 26cf26d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

platform/ui/console_routes.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ func (qmc *QuesmaManagementConsole) createRouting() *mux.Router {
6767
router.HandleFunc(healthPath, qmc.checkHealth)
6868
router.Handle(metricsPath, promhttp.Handler())
6969

70-
qmc.initPprof(router)
71-
7270
// just for oauth compliance
7371
router.HandleFunc("/auth/{provider}", gothic.BeginAuthHandler)
7472
router.HandleFunc("/auth/{provider}/callback", authCallbackHandler)
@@ -86,6 +84,8 @@ func (qmc *QuesmaManagementConsole) createRouting() *mux.Router {
8684
authenticatedRoutes.Use(authMiddleware)
8785
}
8886

87+
qmc.initPprof(authenticatedRoutes)
88+
8989
authenticatedRoutes.HandleFunc("/", func(writer http.ResponseWriter, req *http.Request) {
9090
buf := qmc.generateDashboard()
9191
_, _ = writer.Write(buf)
@@ -317,6 +317,7 @@ func (qmc *QuesmaManagementConsole) initPprof(router *mux.Router) {
317317
router.HandleFunc("/debug/pprof/allocs", pprof.Handler("allocs").ServeHTTP)
318318
router.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
319319
router.HandleFunc("/debug/pprof/trace", pprof.Trace)
320+
router.HandleFunc("/debug/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP)
320321
}
321322

322323
// Here we generate keys for the session store.

0 commit comments

Comments
 (0)