parca-dev / parca-agent

eBPF based always-on profiler auto-discovering targets in Kubernetes and systemd, zero code changes or restarts needed!
https://parca.dev/
Apache License 2.0
554 stars 68 forks source link

JVM support #1

Closed brancz closed 4 weeks ago

brancz commented 3 years ago

This could be a built-in and pprof-integrated version of perf-map-agent and/or async-profiler.

Plan

  1. In Phase one, use async-profiler to profile JVM processes. https://github.com/parca-dev/parca-agent/issues/1115
  2. In Phase two, use the eBPF profiler to collect the profiles.
cskinfill commented 3 years ago

any progress with JVM support?

brancz commented 3 years ago

If the JVM is started with the above-linked perf-map-agent then soon there will be support. The important one is https://github.com/parca-dev/parca-agent/pull/101, but we still lack support for translating container PID to kernel-wide PID, I'm hoping to get to that this week. That said we want users not to have to do anything, so even when that does work, we will keep this open as we want parca-agent to do it all eventually.

brancz commented 2 years ago

Starting with the v0.3.0 release if the perf-map agent is used, then JVM can be profiled with parca-agent today!

brancz commented 2 years ago

Looks like there is also some precedence of profilers at the intersection of eBPF and java, that some inspiration could come from: https://github.com/weixingsun/jBProF

petr-postulka commented 2 years ago

Hi, is there any update for this ticket? Any ETA when JVM profiling is supported by parca-agent by default?

kakkoyun commented 2 years ago

We just started working on this. We plan to land an initial support before this year ends.

Hixon10 commented 2 years ago

FYI: Maybe https://github.com/grafana/JPProf helps somehow with implementation for given task.

kakkoyun commented 2 years ago

FYI: Maybe https://github.com/grafana/JPProf helps somehow with implementation for given task.

Thanks for the suggestion. JPProf is a library you need to add to your application, so it's instrumentation. We are planning to provide an experience where you don't need to change anything in your application :)

fzyzcjy commented 1 year ago

Hi, is there any updates (after two years)? This project looks quite interesting, and I hope to use it in my environment!

brancz commented 1 year ago

We’re making progress and a first integrated version should be only a few weeks away.

Just to be clear though, you have always been able to profile Java workloads by enabling these flags: https://github.com/parca-dev/parca-demo/blob/882b4e77496507ec4b0b839df5dd15c6beff8dd2/java/Dockerfile#L19

xpbob commented 5 months ago

Hi, I am very interested in this JVM support. Is there any new progress?

gnurizen commented 4 weeks ago

New agent supports JVM w/o any instrumentation necessary.