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