OpenTelemetry: Unraveling @WithSpan in Kotlin Coroutines and the JVM | HackerNoon
Briefly

The @WithSpan annotation works flawlessly with coroutines, due to its design which accommodates the asynchronous nature of coroutines, allowing seamless integration with OpenTelemetry.
Under the hood, @WithSpan involves an annotation processor called WithSpanInstrumentation, which processes the annotation and interacts with the Instrumenter class responsible for span management.
The Instrumenter class is pivotal in OpenTelemetry, as it manages telemetry collection, the lifecycle of spans, and records metrics, enabling detailed observability.
When utilizing the Instrumenter, developers follow a straightforward lifecycle: creating an Instrumenter, checking if spans should start, and marking their beginning and end.
Read at Hackernoon
[
]
[
|
]