elastic / elastic-otel-java

Apache License 2.0
8 stars 7 forks source link

Add inferred spans for virtual thread blockers #178

Open JonasKunz opened 3 months ago

JonasKunz commented 3 months ago

In a recent spacetime I developed a feature to automatically generate spans for when a virtual thread is blocked for a configurable amount of time.

This works by hooking onto JVMTI mount/unmount events for virtual spans. When a span has been unmounted for a time exceeding the threshold a stacktrace is fetched and a span is generated.

The goal of this issue is to cleanup this implementation and to provide as an extension and feature of our otel distro. In the future we might want to contribute this feature to the upsteam project.

Here is the branch of the implementation on my fork.