File tree 1 file changed +8
-1
lines changed
pkg/exporters/k8sexporter
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import (
20
20
"context"
21
21
"net"
22
22
"net/http"
23
- _ "net/http/pprof"
23
+ "net/http/pprof"
24
24
"strconv"
25
25
26
26
"k8s.io/klog/v2"
@@ -95,6 +95,13 @@ func (ke *k8sExporter) startHTTPReporting(npdo *options.NodeProblemDetectorOptio
95
95
util .ReturnHTTPJson (w , ke .conditionManager .GetConditions ())
96
96
})
97
97
98
+ // register pprof
99
+ mux .HandleFunc ("/debug/pprof/" , pprof .Index )
100
+ mux .HandleFunc ("/debug/pprof/cmdline" , pprof .Cmdline )
101
+ mux .HandleFunc ("/debug/pprof/profile" , pprof .Profile )
102
+ mux .HandleFunc ("/debug/pprof/symbol" , pprof .Symbol )
103
+ mux .HandleFunc ("/debug/pprof/trace" , pprof .Trace )
104
+
98
105
addr := net .JoinHostPort (npdo .ServerAddress , strconv .Itoa (npdo .ServerPort ))
99
106
go func () {
100
107
err := http .ListenAndServe (addr , mux )
You can’t perform that action at this time.
0 commit comments