Calling Span.Current() inside a function repeatedly executed during Kotlin Flow consumption may not reliably capture the desired tracing context.
- run
installDistGradle task
- run Gradle task
runWithDatadog
- Log output for
TestService.doSomethinghas a valid Span context for all invocations
- Log output shows that only the first and second invocation of
TestService.doSomethinghas a valid span context
- When executed with OTel Agent ( using Gradle task
runWithOtel) also the first and second invocation ofTestService.doSomethinghas a valid span context
- run
installDistGradle task
- run Gradle task
runWithDatadog
- Log output of LoggingWriter and logs from
com.example.TestJobandcom.example.TestServiceshow the same Trace and Span IDs
- Log output shows different IDs for custom logs and DD Agent logs
- When executed with OTel Agent ( using Gradle task
runWithOtel) the Trace and Span IDs match