Java Profiling with async-profiler
async-profiler 4.2+ attaches to a JVM and can push OTLP Profiles (-o otlp).
Experimental OTLP output
async-profiler's -o otlp output is still experimental. Re-test after you upgrade async-profiler.
Send profiles
Run a Collector with the OTLP Profiles exporter, then point asprof at it:
asprof --loop 60s -e cpu -o otlp \
-f http://127.0.0.1:4318/v1development/profiles \
8983Replace 8983 with the JVM PID. --loop 60s starts a new 60-second profile each window and POSTs it.
Start with the JVM instead of attaching later. -agentpath:lib=options is one argument — no space before =.
java -agentpath:/path/to/libasyncProfiler.so=start,event=cpu,loop=60s,otlp,file=http://127.0.0.1:4318/v1development/profiles \
-jar app.jarEvents
| Goal | Flags |
|---|---|
| CPU | -e cpu (default) |
| Allocations | -e alloc |
| Lock contention | -e lock |
See async-profiler profiling modes for wall-clock, native memory, and other events (asprof list).
Do not use --all in production
--all turns on CPU, wall, allocation, lock, and native-memory profiling at the same time. Overhead is high. For continuous profiling, pick one event from the table above.
Verify in OpenObserve

Next steps
- OTLP Profiles: Collector exporter,
Authorization: Basic, andservice.name. - async-profiler profiling modes
Need some help?
- Join our Community Slack
- Or Contact support
Last updated on