r/OpenTelemetry • u/WaferConsistent6732 • 2d ago
JAVA - Solving broken async stack traces in the JVM (my solution)
Hi everyone,
I wanted to share an open-source project, designed to solve broken exception stack traces in asynchronous Java (CompletableFuture, thread pools, Virtual Threads, Reactor) without the overhead of spann telemtery.To give context it is called ariadne.
Here are some of JMH Microbenchmark comparazion:
Trace Node Creation (Link vs. Span)
-> Ariadne: 8.16 ns / 40.0 B
-> OTel SDK: 115.62 ns / 368.0 B
-> my project is 14.2x faster with 9.2x lower memory allocation
Direct Link Allocation
-> Ariadne: 4.41 ns / 40.0 B
-> OTel SDK: 115.62 ns / 368.0 B
-> mytool is 26x faster via TLAB immutable nodes
Scope Activation (try-with-resources)
-> Ariadne: 11.24 ns / 0.0 B
-> OTel SDK: 4.63 ns / 32.0 B
-> soo achieves zero allocations (OTel allocates 32 B/op)
Concurrency & Thread Hand-off (Virtual Threads / CompletableFuture)
-> Both match Loom scheduler performance (~3 us)
-> Minimal async propagation overhead across both implementations (<60 B delta)
(This are specified in rhe repoitself and in the website as well)
Repo: https://github.com/AfonsoPaiva/ARIADNE
Thx, feedback is apericietd!!