Skip to content

Commit

Permalink
Locate symbolz endpoint with deeper paths (#894)
Browse files Browse the repository at this point in the history
- `http://HOST/profilez` -> `http://HOST/symbolz`
- `http://HOST/some/deeper/path/profilez` -> `http://HOST/some/deeper/path/symbolz`

Co-authored-by: Alexey Alexandrov <aalexand@users.noreply.github.com>
  • Loading branch information
shoban and aalexand authored Sep 27, 2024
1 parent cba816a commit f3f46ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/symbolz/symbolz.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func symbolz(source string) string {
if strings.Contains(url.Path, "/debug/pprof/") || hasGperftoolsSuffix(url.Path) {
url.Path = path.Clean(url.Path + "/../symbol")
} else {
url.Path = "/symbolz"
url.Path = path.Clean(url.Path + "/../symbolz")
}
url.RawQuery = ""
return url.String()
Expand Down
1 change: 1 addition & 0 deletions internal/symbolz/symbolz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func TestSymbolzURL(t *testing.T) {
"http://host:8000/profilez?seconds=5": "http://host:8000/symbolz",
"http://host:8000/profilez?seconds=5&format=proto": "http://host:8000/symbolz",
"http://host:8000/heapz?format=legacy": "http://host:8000/symbolz",
"http://host:8000/some/deeper/path/profilez?seconds=5": "http://host:8000/some/deeper/path/symbolz",
"http://host:8000/debug/pprof/profile": "http://host:8000/debug/pprof/symbol",
"http://host:8000/debug/pprof/profile?seconds=10": "http://host:8000/debug/pprof/symbol",
"http://host:8000/debug/pprof/heap": "http://host:8000/debug/pprof/symbol",
Expand Down

0 comments on commit f3f46ee

Please sign in to comment.