Adds support for Kotlin Coroutines (#1977)

* Added Kotlin Coroutine support
* Added docs, polished code and added one more case for reactor context
This commit is contained in:
Marcin Grzejszczak
2021-06-18 07:30:49 +02:00
committed by GitHub
parent 75b40bb884
commit 7c4d8b1479
16 changed files with 992 additions and 204 deletions

View File

@@ -729,3 +729,10 @@ This feature is available for all tracer implementations.
We're instrumenting the `Session` repositories that wraps all operations in a span.
In order to disable this instrumentation set `spring.sleuth.session.enabled` to `false`.
[[sleuth-kotlin-integration]]
== Kotlin Coroutines
This feature is available for all tracer implementations.
We're adding Kotlin Coroutines that allow you to retrieve the current span via the `Tracer` bean. You can either pass the bean to the Kotlin Coroutine context via `Tracer.asContextElement()` method execution or if you have Reactor Kotlin Coroutine integration on the classpath, we will retrieve it from Reactor's context. To retrieve the current span you can call the `currentSpan()` method within the Kotlin Coroutine.