Skip to content
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

Missing pprof routes #470

Open
hherman1 opened this issue Jul 14, 2022 · 0 comments
Open

Missing pprof routes #470

hherman1 opened this issue Jul 14, 2022 · 0 comments

Comments

@hherman1
Copy link

hherman1 commented Jul 14, 2022

What happened?

Several pprof routes are missing and 404 from the pprof index. This code fixes it:

	pprofs := []string{"goroutine", "block", "allocs", "mutex", "threadcreate"}
	for _, prof := range pprofs {
		err = info.Router.Get("/debug/pprof/"+prof, pprof.Handler(prof))
		if err != nil {
			return nil, fmt.Errorf("register %v route: %w", prof, err)
		}
	}

The reason is that the witchcraft router does not support handlers accepting subpaths, and the net/http/pprof Index handler tries to automatically handle these routes.

What did you want to happen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant