-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add pprof server to moco-controller #500
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
@@ -136,6 +137,13 @@ func subMain(ns, addr string, port int) error { | |||
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]>
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
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-addr
option is set.Usage: View the trace data
--pprof-addr=:9090
option.http://localhost:9091
with a Web brower.Signed-off-by: Masayuki Ishii [email protected]