Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http/pprof: URL path /debug/pprof does not list all the available endpoints #24380

Closed
MikeSpreitzer opened this issue Mar 13, 2018 · 7 comments
Labels
Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@MikeSpreitzer
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

Whatever is in the Docker image quay.io/coreos/hyperkube:v1.8.7_coreos.0.

Here is a possibly informative entry from its /metrics:

kubernetes_build_info{buildDate="2018-01-18T00:17:18Z",compiler="gc",gitCommit="768e049ab5230010251f30475e0e785e2e999566",gitTreeState="clean",gitVersion="v1.8.7+coreos.0",goVersion="go1.8.3",major="1",minor="8+",platform="linux/amd64"}

Does this issue reproduce with the latest release?

I think it does.

What operating system and processor architecture are you using (go env)?

That is a Docker container image. I ran it on Ubuntu 16.04.1, on an Intel processor.

What did you do?

kubectl get --raw /debug/pprof --server https://10.233.110.91 --insecure-skip-tls-verify

What did you expect to see?

I expected to see the complete list of <foo> that makes for a valid path /debug/pprof/<foo>.

BTW, I can not find the complete list in any one central place. Different partial lists can be found: as shown here, in https://golang.org/pkg/net/http/pprof/ , in https://raywangblog.wordpress.com/2017/07/16/golang-profiling/ , and in https://blog.golang.org/profiling-go-programs . In another issue I finally saw a pointer to https://tip.golang.org/doc/diagnostics.html#profiling . But the full list should be in the main doc as well as what the runtime reports.

What did you see instead?

Fetching /debug/pprof got me the following list of choices:

<tr><td align=right>0<td><a href="block?debug=1">block</a>
<tr><td align=right>64<td><a href="goroutine?debug=1">goroutine</a>
<tr><td align=right>18<td><a href="heap?debug=1">heap</a>
<tr><td align=right>0<td><a href="mutex?debug=1">mutex</a>
<tr><td align=right>15<td><a href="threadcreate?debug=1">threadcreate</a>

Astonishingly, profile is missing from that list! So is trace (which is mentioned in https://golang.org/pkg/net/http/pprof/ --- which, distressingly, does not say anything about ?debug=1).

@andybons andybons changed the title URL path /debug/pprof does not list all the available choices net/http/pprof: URL path /debug/pprof does not list all the available choices Mar 14, 2018
@andybons andybons changed the title net/http/pprof: URL path /debug/pprof does not list all the available choices net/http/pprof: URL path /debug/pprof does not list all the available endpoints Mar 14, 2018
@andybons andybons added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Documentation labels Mar 14, 2018
@andybons andybons added this to the Go1.11 milestone Mar 14, 2018
@andybons
Copy link
Member

/cc @hyangah

@hyangah
Copy link
Contributor

hyangah commented Mar 14, 2018

agree that we need to extend net/http/pprof.Index to include the endpoints implemented outside runtime/pprof.Profiles, along with helpful description of endpoints.

Just we need to make sure the binary format outputs have correct Content-Type headers and browsers handle them appropriately. The reason debug=1 is specified for other profiles is that it outputs in the text format. For CPU profiles or execution trace, that option is not available.

@andybons andybons added help wanted NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Mar 14, 2018
@agnivade
Copy link
Contributor

agnivade commented May 8, 2018

Taking this. The "/debug/pprof" endpoint is seriously lacking in clarity. It's not even clear what the nos. in the left column stand for.

@agnivade agnivade self-assigned this May 8, 2018
@agnivade
Copy link
Contributor

agnivade commented May 9, 2018

I am thinking of revamping the page a bit.

Couple of points to consider:

  • The goroutine profiles of debug=1 and debug=2 should be under the same header. Currently, it is just a single link outside the list.
  • non-runtime profiles don't have a count attribute. So we cannot just append to the pprof.Profiles() slice and iterate it in the template. Additional fields need to be added to denote whether a profile has a count field or not.
  • Additionally, if we are to add a description field, it is better that we move away from the table format to a list format.

I will send a CL along with screenshots soon.

@hyangah
Copy link
Contributor

hyangah commented May 9, 2018

Thanks!

Can you clarify what you mean by "non-runtime" profile in the second bullet?

@agnivade
Copy link
Contributor

agnivade commented May 9, 2018

Can you clarify what you mean by "non-runtime" profile in the second bullet?

The endpoints implemented outside runtime/pprof.Profiles. AKA, those endpoints which are exposed from net/http/pprof.

@gopherbot
Copy link

Change https://golang.org/cl/112495 mentions this issue: net/http/pprof: update the /debug/pprof endpoint

@golang golang locked and limited conversation to collaborators May 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants