-
Notifications
You must be signed in to change notification settings - Fork 164
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
agentlog: add pprof debug http handler #3229
Conversation
pprof show various insights into the process and can be accessed via http://localhost:6543/debug/pprof/ to start it, send USR2; to stop it, do curl localhost:6543/stop -X POST Signed-off-by: Christoph Ostarek <christoph@zededa.com>
mux := http.NewServeMux() | ||
|
||
server := &http.Server{ | ||
Addr: ":6543", |
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.
Let's perhaps change this to localhost:6543
so that it is explicit that this is not reachable from outside (in any case iptables will block access attempt).
Edit: Or are you able to access it from outside and is that intentional? (I see you added port forwarding rule for Qemu)
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 am able to access it from outside (intentionally) until the device is onboarded (not intentionally).
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.
(eve firewall drop helps)
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 think we should have this available externally so localhost sounds right.
If we need easy access to this for remote debugging them it would make sense to explore what set of commands we'd need to add to edgeview to be able to get this information. But if it is for lab/testing/tuning (and not production) access, then assuming that the user can ssh or edgeview into a shell in EVE and then run local commands seems reasonable.
Maybe we should take this opportunity to document all the features of agentlog that one may use for debugging purposes? (e.g. under this folder) |
func listenDebug() { | ||
mux := http.NewServeMux() | ||
|
||
server := &http.Server{ |
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.
Did you see the golangcilint warning in https://github.com/lf-edge/eve/pull/3229/files?
I close this PR for now and reopen it when I actually have time to improve it. |
Unfortunately I cannot reopen this PR as I force-pushed ... |
pprof show various insights into the process and can be accessed via http://localhost:6543/debug/pprof/
to start it, send USR2; to stop it, do
curl localhost:6543/stop -X POST