Skip to content

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

@jholdstock

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)
}
}()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions