-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
What version of Go are you using (go version)?
I have tested on:
go version go1.9.2 darwin/amd64
go version go1.9.2 linux/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env)?
darwin: GOARCH=amd64 GOOS=darwin
linux: GOARCH=amd64 GOOS=linux
What did you do?
pprof labels that I add using pprof.Do() do not appear in the goroutine profile.
Steps:
- Compile and start: https://play.golang.org/p/SgYgnDqaVKB
- Start "go tool pprof localhost:5555/debug/pprof/goroutine"
- Run the "tags" command
- See no tags, but I expect to see a tag for the label a-label=a-value
I also downloaded the file "localhost:5555/debug/pprof/goroutine"", gunzipped that file, and did not see either the label key nor value in the protobuf file.
When I run "go tool pprof localhost:5555/debug/pprof/goroutine" twice and in the second run run "tags", I see
(pprof) tags
bytes: Total 3
2 (66.67%): 325.31kB
1 (33.33%): 902.59kB
This shows that labels can work. (I expect no output on the first run, since it is reasonable for no heap memory to have been allocated.)
What did you expect to see?
I expect to see the tags command output the label key-value pair in the program.
What did you see instead?
The tags command reports an empty value:
(pprof) tags
(pprof)