Tracing Coroutines on a JVM
summary
Tracing breaks when coroutine continuations move between threads because ThreadLocal trace context gets lost; the claim is that CopyableThreadContextElement copies and restores that context so Java tracing (OpenTelemetry/Dapper-style) remains coherent across suspend/resume boundaries. Implementation uses Kotlin Coroutines hooks plus small callback glue to sync per-coroutine storage with executor threads, works in hybrid Java Executor/Kotlin coroutine programs, and patches are accepted into Kotlin coroutines so the mechanism is deployable in real services.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 0:41What is tracing
- 3:50Race condition
- 4:32ThreadContext Element
- 6:12Deployment
- 6:46Use Cases
- 7:31Conclusion
related talks
54mA TRACE TO REMEMBER: COMPOSITIONAL TRACING
47mI'm Tracing You!
25mPerfect Match: Correlating Continuous Profiling with Distributed Tracing for Stronger Observability
31mZero* Cost Observability: A Deep Dive into the Jetpack Multiplatform Tracing Library
48mKeep your sanity with compositional tracing
49mDistributed Tracing in Java? OpenTelemetry for the Rescue!
41mThe Future of Tracing
31mDistributed Tracing Integration with OpenTelemetry and Knative
