pyroscope-java icon indicating copy to clipboard operation
pyroscope-java copied to clipboard

Thread-level support

Open tomershafir opened this issue 1 year ago • 2 comments

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
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?

tomershafir avatar Jul 30 '23 19:07 tomershafir

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 ?

korniltsev avatar Jul 31 '23 12:07 korniltsev

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

tomershafir avatar Jul 31 '23 15:07 tomershafir