Skip to content

Commit b3bf9e6

Browse files
committed
Enable pprof
1 parent bd30696 commit b3bf9e6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package main
1919

2020
import (
2121
"flag"
22+
"net/http"
23+
"net/http/pprof"
2224
"os"
2325

2426
// Load all auth plugins
@@ -151,6 +153,13 @@ func main() {
151153
}
152154

153155
cmd.monitoringServer = monitoring.NewServer(adapterCfg, cmd.MonitoringPort, cmd.PrometheusMetricsEnabled)
156+
157+
http.HandleFunc("/debug/pprof/", pprof.Index)
158+
http.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
159+
http.HandleFunc("/debug/pprof/profile", pprof.Profile)
160+
http.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
161+
http.HandleFunc("/debug/pprof/trace", pprof.Trace)
162+
154163
go cmd.monitoringServer.Start()
155164

156165
elasticsearchProvider := cmd.makeProviderOrDie(adapterCfg)

0 commit comments

Comments
 (0)