go - 通过 "go tool pprof"获取配置文件时指定 jwt token

标签 go jwt pprof

我的 api 通过 jwt 进行保护,通过 go tool pprof 获取配置文件时是否可以指定 jwt token ?

目前,我必须配置 jwt 中间件来绕过 /debug/pprof 路由。

最佳答案

我找不到直接通过 go tool pprof 传递 token 的方法,但由于您可以使用 curl 来获取配置文件,因此是一个简单的解决方法:

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

关于go - 通过 "go tool pprof"获取配置文件时指定 jwt token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73277356/

相关文章:

go - 如何使用 glide golang 安装私有(private)仓库

dictionary - 无法获取 map 元素的地址

go - 如何分析 goroutines 的数量

go - 是什么导致 go 在 runtime.pthread_cond_signal 中花费这么多时间

go - 多次运行相同的go程序会引发 panic : send on closed channel

mongodb - 使用 mongo.Connect 时连接未打开,而当我执行查询时连接未打开

authentication - Spring-boot JWT 注销

html - 实现 JWT 存储以允许浏览器刷新但在选项卡/浏览器关闭时清除

asp.net-core - 存储/验证存储在 .net core api 中的 HttpOnly cookie 中的 JWT token

go - 在分析 go 程序时是否可以提高采样率?