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

Package JPProf as a Java agent #20

Open
ahus1 opened this issue Nov 10, 2022 · 4 comments
Open

Package JPProf as a Java agent #20

ahus1 opened this issue Nov 10, 2022 · 4 comments

Comments

@ahus1
Copy link

ahus1 commented Nov 10, 2022

It would be great to package JPProf as a Java agent, so I can specify it on the command line of an existing application and don't need to change my applications.

java -javaagent:jpprof-javaagent.jar -jar myapp.jar

Other frameworks like open telemetry do this already. See https://github.com/open-telemetry/opentelemetry-java-instrumentation, and looking at the standalone example this should hopefully be possible.

There would be the need to pass the port as a parameter, for example as a system property (-Dgrafana.jpprof.port=xxx).

Thanks!

@ahus1
Copy link
Author

ahus1 commented Nov 21, 2022

A friend showed me kubectl-flame (https://github.com/yahoo/kubectl-flame) which uses a separate container to fetch the profiling information, which also works for Java containers. This would avoid running the Java container itself as a privileged pod and wouldn't require changing existing deployments.

Any thoughts on that approach? Thanks!

@fstab
Copy link
Member

fstab commented Nov 21, 2022

Hi Alexander, I agree that having a profiler that you can just attach to any application without requiring code change would be great. We have this on our roadmap, but it might take a while until it gets done.

@ahus1
Copy link
Author

ahus1 commented Nov 21, 2022

Hi Fabian - long time no see! Good to know that this is on the road map, will keep an eye on it!

@smagnacco
Copy link

Hey, have you seen that https://github.com/dpsoft/ap-agent is an agent that already support pprof and expose an api?

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

3 participants