grafana / pyroscope-java

pyroscope java integration
Apache License 2.0
72 stars 31 forks source link

Thread-level support #103

Open tomershafir opened 11 months ago

tomershafir commented 11 months ago

Async-profiler can label samples by tid, and dump it in bottom of stack traces for non-jfr, or in meta table if jfr. I tried both:

  1. PYROSCOPE_AP_EXTRA_ARGUMENTS=jstackdepth=1024,threads
    PYROSCOPE_PROFILER_EVENT=itimer
    PYROSCOPE_FORMAT=jfr
  2. PYROSCOPE_AP_EXTRA_ARGUMENTS=jstackdepth=1024,threads
    PYROSCOPE_PROFILER_EVENT=itimer
    PYROSCOPE_FORMAT=collapsed

but it ends up in grafana cloud pyroscope app plugin without tid. I guess its server issue?

korniltsev commented 11 months ago

Yeah. The bits are there, I will need to adjust jfr parser. This will increase number of series (as it will most likely go to a label, or should it go to a fake leaf node?) Also it should be optional. How do I decide when to add thread and when not? An api query param? Or maybe there's info in the jfr itself, need to check. I have same questions for allocation type, size and maybe locks.

I wonder what do you think @petethepig @kolesnikovae @simonswine ?

tomershafir commented 11 months ago

I'm not intimately familiar with the storage engine, but I guess a label makes sense. jfr has the thread table anyway, so maybe:

  1. Opt-in server event type level granularity config
  2. Optional api param override
  3. GUI knub