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

agentlog: add pprof debug http handler #3229

Closed

Conversation

christoph-zededa
Copy link
Contributor

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

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",
Copy link
Contributor

@milan-zededa milan-zededa May 19, 2023

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)

Copy link
Contributor Author

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(eve firewall drop helps)

Copy link
Contributor

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.

@milan-zededa
Copy link
Contributor

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{
Copy link
Contributor

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?

@christoph-zededa
Copy link
Contributor Author

I close this PR for now and reopen it when I actually have time to improve it.

@christoph-zededa
Copy link
Contributor Author

Unfortunately I cannot reopen this PR as I force-pushed ...

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

Successfully merging this pull request may close these issues.

3 participants