Skip to content

proposal: net/http/pprof: provide a mechanism to render on /debug/pprof profiles than those that invoke pprof.NewProfile #41324

Closed
@brancz

Description

@brancz

I'm investigating the possibility of discovering available profiles of a process through the /debug/pprof/ index page. If that's a bad idea then we can stop right here 🙂 , but if not, then it would be great if there could be a mechanism to extend the profiles rendered on this page.

I have looked around and found that it appears that if profiles are created using the pprof.NewProfile function, then they are automatically included in profiles returned by pprof.Profiles(), which is what the /debug/pprof index page calls to retrieve the list of available profiles.

The custom profile I was looking at including is fgprof, however, fgprof is unsuitable for making use of pprof.NewProfile(). This led me to opening this issue.

Would it be possible to have another mechanism to add profile endpoints to be rendered into the /debug/pprof/ index page? I could see the possibility of an extensible list of endpoints in net/http/pprof/.

Happy to discuss other strategies if the general idea sounds acceptable, and once agreed I'd also be happy to contribute it.

Related: felixge/fgprof#5 parca-dev/parca#69

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions