Skip to content

Commit

Permalink
remove pprof endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <[email protected]>
  • Loading branch information
rubenvp8510 committed Dec 9, 2024
1 parent ab36568 commit 2a60591
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions cmd/root/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package root
import (
"errors"
"fmt"
"net/http"
"net/http/pprof"
"os"
"path/filepath"
"reflect"
Expand Down Expand Up @@ -65,22 +63,6 @@ func mergeOptionsFromFile(o manager.Options, cfg *configv1alpha1.ProjectConfig)

if o.Metrics.BindAddress == "" && cfg.Metrics.BindAddress != "" {
o.Metrics.BindAddress = cfg.Metrics.BindAddress

endpoints := map[string]http.HandlerFunc{
"/debug/pprof/": pprof.Index,
"/debug/pprof/cmdline": pprof.Cmdline,
"/debug/pprof/profile": pprof.Profile,
"/debug/pprof/symbol": pprof.Symbol,
"/debug/pprof/trace": pprof.Trace,
}

if o.Metrics.ExtraHandlers == nil {
o.Metrics.ExtraHandlers = map[string]http.Handler{}
}

for path, handler := range endpoints {
o.Metrics.ExtraHandlers[path] = handler
}
}

if o.HealthProbeBindAddress == "" && cfg.Health.HealthProbeBindAddress != "" {
Expand Down

0 comments on commit 2a60591

Please sign in to comment.