Skip to content

Commit

Permalink
chore: parameterize host and port for pprof http server using env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
fbgava-wildlife committed Nov 18, 2024
1 parent 8f71ff5 commit 8159828
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion feedback/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ func NewListener(
func (l *Listener) loadConfigurationDefaults() {
l.Config.SetDefault("feedbackListeners.gracefulShutdownTimeout", 1)
l.Config.SetDefault("stats.flush.s", 5)

l.Config.SetDefault("pprof.host", "127.0.0.1")
l.Config.SetDefault("pprof.port", 8081)
}

func (l *Listener) configure(statsdClientrOrNil interfaces.StatsDClient) error {
Expand Down Expand Up @@ -251,8 +254,9 @@ func (l *Listener) StartPprofServer() error {
mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
mux.HandleFunc("/debug/pprof/trace", pprof.Trace)

addr := fmt.Sprintf("%s:%d", l.Config.GetString("pprof.host"), l.Config.GetInt("pprof.port"))
server := &http.Server{
Addr: "127.0.0.1:8081",
Addr: addr,
Handler: mux,
}

Expand Down

0 comments on commit 8159828

Please sign in to comment.