-
Notifications
You must be signed in to change notification settings - Fork 645
Add Java support #94
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
Comments
Just use the eBPF mode and bcc tools for java scripts. https://github.com/iovisor/bcc/tree/master/tools |
Also this https://github.com/jvm-profiling-tools/async-profiler (also has converters, JFR to Flame Graph, JFR to FlameScope, collapsed stacks to Flame Graph) |
Hi, I've been doing some experiments with async-profiler and it preliminary seems possible to use its slightly modified Java agent library to provide stacktraces in some form back to the Pyroscope agent. I'm planning to continue these experiments and would be happy to contribute to Pyroscope. |
@ivanyu Hi Ivan, this sounds very promising. I would love to talk in more detail about the integration. I reached out over email. Looking forward to talking to you. |
Talked to Ivan yesterday. We decided to go with We're going to distribute the java side of the integration as a jar file that people will be able to add to their applications as a Java agent, here's an example from a blog post Ivan wrote:
There are a couple of options when it comes to integrating with this on pyroscope side:
Option A pros / cons
Option B pros / conspros / cons are pretty much the opposite of pros and cons of option A I also made a little diagram illustrating the difference: Which way we should go?Based on this list of pros and cons I lean towards option B. @ivanyu @kolesnikovae Would love to hear what you think about these options and this plan in general. |
I'm inclined towards Option B mainly for:
|
Agree that virtual heap annotation with standalone executables is best. On Postgres for instance you may want to profile by SQL statement execution. You want both the virtual and eBPF traces. On one box you could be running Ruby, Go, and two JVMs all at once. Pyroscope should be able to detect if is a PID is running an application with a known virtual annotator. The detector needs to be customizable; binary path, crunching the command line arguments, analysis of the ELF/machO header ... all might be used to fingerprint. The logging format needs to be standardized into a sqlite file format with binary blobs where appropriate. Memory tracing is the big thing that few are doing. Dumping 16GB RAM for analysis isn't feasible. It is feasible to dump /usr/bin/time -v counters, /proc/PID/memory_maps, and have the ability to run OS pages through the zram compressor (usually zstd) and know how compressible they are. When you have extremely compressible pages you know memory isn't being used efficiently. I'll have to dig into the Linux and XNU kernels to see how to get OS page staleness. Generic executables profiled with eBPF need the debug symbols processed. Prodfiler is doing this cloud side by uploading the entire binary - this is a PITA for code that isn't a binary from a major Linux distro. There is innovation here for keeping analysis on localhost for "cargo test" instead of uploading the binary every local build. OpenTracing is becoming a standard. There should be some way of (PID, timestamp) logging on an incoming trace so you can pull all stacks corresponding to a particular incoming API call. |
hello, I found in the documentation that the eBPF agent supports the Java language. It requires perf-map-agent. Is there any more detailed documentation? |
The docs explaining how to enable perf map would be here Although the original pyrscope supported perf map symbols, the grfafana-agent pyroscope.ebpf does not support it just yet |
Found this open source project that may help
The text was updated successfully, but these errors were encountered: