Set 'kotlinx.coroutines.debug' to See Kotlin Co Routines Names

Setting kotlinx.coroutines.debug system property causes underlying platform to append co-routine name to the thread name when Thread.currentThread().name is called.

To set this for tooling to pick it up use

  export JAVA_TOOL_OPTIONS="-Dkotlinx.coroutines.debug"

Example Thread.currentThread().name

  • Before: pool-1-thread-1
  • After: pool-1-thread-1 @coroutine#1