-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
提供的pprof有问题 #1701
Labels
bug
Something isn't working
Comments
提供个最小复现环境? |
就在http.go里加了 srv.Handle("/debug/pprof/", pprof.NewHandler())这一行 |
试一下 srv.Handle("/", pprof.NewHandler()) |
不行 |
那你提供一下 最小仓库吧 |
好的 |
@haiyux |
点击allocs 404 |
package main
import (
"github.com/go-kratos/kratos/v2"
"github.com/go-kratos/kratos/v2/transport/http"
"github.com/go-kratos/kratos/v2/transport/http/pprof"
)
func main() {
server := http.NewServer(
http.Address("0.0.0.0:8882"),
)
server.HandlePrefix("/", pprof.NewHandler())
kratos.New(kratos.Server(server)).Run()
} 先试一下这个 |
package main
import (
"github.com/go-kratos/kratos/v2"
"github.com/go-kratos/kratos/v2/transport/http"
"github.com/go-kratos/kratos/v2/transport/http/pprof"
)
func main() {
server := http.NewServer(
http.Address("0.0.0.0:8882"),
)
server.HandlePrefix("/", pprof.NewHandler())
server.Handle("/debug/pprof/", pprof.NewHandler())
server.Handle("/debug/pprof/cmdline", pprof.NewHandler())
server.Handle("/debug/pprof/profile", pprof.NewHandler())
server.Handle("/debug/pprof/symbol", pprof.NewHandler())
server.Handle("/debug/pprof/trace", pprof.NewHandler())
kratos.New(kratos.Server(server)).Run()
} 或者这个 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使用了 pprof.NewHandler() 方法,访问 http://192.168.1.117:8888/debug/pprof/allocs?debug=1 404
Environment:
kratos -v
):kratos version v2.1.2
go version
):go version go1.16.3 windows/amd64
cat /etc/os-release
):win10
The text was updated successfully, but these errors were encountered: