Prior to this commit, the Micrometer context-propagation project would help propagating information from `ThreadLocal`, Reactor `Context` and other context objects. This is already well supported for Micrometer Observations. In the case of Kotlin suspending functions, the processing of tasks would not necessarily update the `ThreadLocal` when the function is scheduled on a different thread. This commit introduces the `PropagationContextElement` operator that connects the `ThreadLocal`, Reactor `Context` and Coroutine `Context` for all libraries using the "context-propagation" project. Applications must manually use this operator in suspending functions like so: ``` suspend fun suspendingFunction() { return withContext(PropagationContextElement(currentCoroutineContext())) { logger.info("Suspending function with traceId") } } ``` Closes gh-35185 |
||
---|---|---|
.. | ||
core | ||
data-access | ||
integration | ||
languages | ||
testing | ||
web | ||
appendix.adoc | ||
core.adoc | ||
data-access.adoc | ||
index.adoc | ||
integration.adoc | ||
languages.adoc | ||
overview.adoc | ||
page-layout.adoc | ||
rsocket.adoc | ||
testing.adoc | ||
web-reactive.adoc | ||
web.adoc |