Skip to content

go profiler should not listen on all endpoints by default #3591

Description

@jholdstock

Ideally the flag to enable the profiler would be a string so the admin can specify the endpoint, but if using a bool it should listen on loopback interfaces only.

if opts.HTTPProfile {
log.Warnf("Starting the HTTP profiler on path /debug/pprof/.")
// http pprof uses http.DefaultServeMux
http.Handle("/", http.RedirectHandler("/debug/pprof/", http.StatusSeeOther))
go func() {
if err := http.ListenAndServe(":9232", nil); err != nil {
log.Errorf("ListenAndServe failed for http/pprof: %v", err)
}
}()
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions