$ java -XX:StartFlightRecording:maxsize=10M,filename=dump.jfr -jar app.jar
$ jfr view all-views dump.jfr > report.txt
$ jfr print dump.jfr > all.txt
Then ask Codex, or whatever AI tool you use, to analyze report.txt for issues and use all.txt to dig deeper, if needed.There's also async profiler. LLMs just use whatever. Lots of choices.
If you want to collect these, telegraf has a jolokia plugin. It's an incredible combination!