Skip to content

Commit efd3008

Browse files
authored
fix(controller): Fixed broken pprof links #4037 (#4038)
Signed-off-by: Derek Brown <[email protected]>
1 parent c0ca530 commit efd3008

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

USERS.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Organizations below are **officially** using Argo Rollouts. Please send a PR wit
4242
1. [PagerDuty](https://www.pagerduty.com/)
4343
1. [PayPal](https://www.paypal.com/)
4444
1. [PayPay](https://paypay.ne.jp/)
45+
1. [Plaid](https://plaid.com/)
4546
1. [Priceline](https://priceline.com)
4647
1. [Productboard](https://www.productboard.com)
4748
1. [Quipper](https://www.quipper.com/)

controller/profiling.go

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
package controller
22

33
import (
4-
"fmt"
54
"net/http"
65
"net/http/pprof"
76
)
87

9-
const (
10-
ProfilingPath = "/debug/pprof"
11-
)
12-
138
// NewPProfServer returns a new pprof server to gather runtime profiling data
149
func NewPProfServer() *http.ServeMux {
1510
mux := http.NewServeMux()
1611

17-
mux.HandleFunc(ProfilingPath, pprof.Index)
18-
mux.HandleFunc(fmt.Sprintf("%s/cmdline", ProfilingPath), pprof.Cmdline)
19-
mux.HandleFunc(fmt.Sprintf("%s/profile", ProfilingPath), pprof.Profile)
20-
mux.HandleFunc(fmt.Sprintf("%s/symbol", ProfilingPath), pprof.Symbol)
21-
mux.HandleFunc(fmt.Sprintf("%s/trace", ProfilingPath), pprof.Trace)
12+
// TODO: Remove enumerating all pprof endpoints if/when a more ergonomic
13+
// attachment solution is introduced. See: https://github.com/golang/go/issues/71213.
14+
mux.HandleFunc("/debug/pprof/", pprof.Index)
15+
mux.HandleFunc("/debug/pprof/cmdline/", pprof.Cmdline)
16+
mux.HandleFunc("/debug/pprof/profile/", pprof.Profile)
17+
mux.HandleFunc("/debug/pprof/symbol/", pprof.Symbol)
18+
mux.HandleFunc("/debug/pprof/trace/", pprof.Trace)
2219

2320
return mux
2421
}

0 commit comments

Comments
 (0)