-
Notifications
You must be signed in to change notification settings - Fork 33
Add pprof server to moco-controller #500
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
Conversation
169de55 to
d54dfe4
Compare
Signed-off-by: Masayuki Ishii <[email protected]>
| mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) | ||
| mux.HandleFunc("/debug/pprof/trace", pprof.Trace) | ||
|
|
||
| server := &http.Server{Addr: h.bindAddr, Handler: mux} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't use cybozu-go/well to keep the log format consistent with the reconciler.
For this usage, the default http server is enough, in my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. 👍
cmd/moco-controller/cmd/run.go
Outdated
| return err | ||
| } | ||
|
|
||
| if config.pprofAddr != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to disable pprof even when 0 is specified.
This is because it will be incompatible when using controller-runtime's pprof in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good. Fixed. 6cf0e1c
Signed-off-by: Masayuki Ishii <[email protected]>
kmdkuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
zoetrope
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add pprof server to moco-controller.
The pprof server will start only when
--pprof-addroption is set.Usage: View the trace data
--pprof-addr=:9090option.http://localhost:9091with a Web brower.Signed-off-by: Masayuki Ishii [email protected]