Eric
Eric

Reputation: 24994

Specify jwt token when fetch profile via "go tool pprof"

My api is protected via jwt, is it possible to specify a jwt token when fetch profile via go tool pprof ?

Currently, I have to config jwt middleware to bypass the /debug/pprof routes.

Upvotes: 2

Views: 1015

Answers (1)

Cyprian
Cyprian

Reputation: 11374

I couldn't find a way to pass a token via go tool pprof directly, but due to the fact that you can use curl to fetch the profile, there is a simple workaround:

$ curl -o profile.out https://host/debug/pprof -H 'X-Authorization: $TOKEN'
$ go tool pprof profile.out

Upvotes: 2

Related Questions