Make pyroscope-java tightly coupled to ap, which makes sense because it's a great oss jvm profiler, and an alternative would be hard to find. Then, a single text param will make sense and be flexible.
Make pyroscope-java a simple, loosely coupled abstraction, with profiler agnostic interface. In this case I would even suggest to remove APExtraArgs from the generic interface, and extend it when needed.
@korniltsev I think you need to make a decision:
I would go with 2.