To add power to the spring boot actuator, I have been running a Web endpoint that allows developer & tools to profile the JVM and give meaningful representation back (flamegraphs to human and JFR export to tools). Using async-profiler can add lots of value to Spring boot eco system.

Comment From: wilkinsona

Thanks for the suggestion. There's quite a lot to the async profiler, as illustrated by all the options that the profiler.sh script can take. Could you share a bit more about what you've done in your endpoint, what works well for you, etc?

Comment From: JigarJoshi

I have hand built their Java library and their linux specific binary and I load the native library and expose actuator endpoint that takes some parameters like event/duration/output format and then render the output.

For Spring boot to use it, first async-profiler has to be published to central maven repository. As a first step towards it I am working on https://github.com/jvm-profiling-tools/async-profiler/issues/93

I will be happy to add this once async-profiler is available in central maven repository.

Comment From: wilkinsona

Thanks. Unfortunately, publishing the profiler to Maven Central doesn't seem to be getting much traction. While that's the case, I don't think there's much point in keeping this issue open as we may never be able to act upon it. I'm going to close this one for now. Please let us know by commenting here if the situation changes and there's a clear picture of what would be involved in the proposal. We can then re-open the issue and take another look.

Comment From: parttimenerd

I'm going to work on publishing an async-profiler wrapper to maven central in the following days. This will build all async-profiler releases automatically (on the sapmachine.io build infrastructure, on all platforms supported by async-profiler), combine them into a single JAR which uses the appropriate async-profiler library for every platform. A library building upon this will then create a wrapper around JFR and async-profiler, so that there is a fallback for unsupported platforms.

I hope this might help.

Comment From: parttimenerd

The library can be found at https://github.com/parttimenerd/ap-loader

Comment From: wilkinsona

Thanks, @parttimenerd.

@JigarJoshi, now that there's something on Central, would you like to expand a bit on "I load the native library and expose actuator endpoint that takes some parameters like event/duration/output format and then render the output"?

Comment From: parttimenerd

You could do something like done by Mirko Sertic in https://github.com/mirkosertic/flight-recorder-starter. I would recommend running async-profiler with the option --jfrsync --alloc anyways, so you could JFR related code. You could even use https://github.com/parttimenerd/jfrtofp to export JFR to the speedscope format to have a more interactive view.

Comment From: parttimenerd

I'm happy to help implementation the feature.

Comment From: andris-rauda

I was thinking about ways of integrating async-profiler into project that I'm currently working on and had exactly the same train of thought - it could be implemented as a Spring Boot Actuator. It's a pity this issue is closed. Will see if I can make this happen and contribute a pull request.

Comment From: parttimenerd

The ap-loader library is now quite mature, so it could be a good base :)

Comment From: andris-rauda

JFI: pull request #23988 to integrate this into Spring Boot directly has been declined, the reasoning is valid. As suggested by @wilkinsona, I've started an effort to make this as a separate library here: https://github.com/nifties-dev/async-profiler-actuator

Will see how it goes..