春季的ziputh跨度不能嵌套在Kotlin协同程序中

我可以看到从下面的Spring Boot控制器代码在Zipkin UI中记录跨度:

@RestController class ConcurrentController { @Autowired lateinit var restTemplate : RestTemplate val urls = arrayListOf<String>("http://www.google.com","http://www.facebook.com") private val logger = Logger.getLogger(this::class.java.getName()) @RequestMapping("/concurrent1") fun endPoint1() : String { logger.info("/concurrent1") var s = "" runBlocking { val a = urls.map { url -> logger.info(url) async(CommonPool) { logger.info("getting $url") restTemplate.getForObject(url, String::class.java) sleep(5000) logger.info("got $url") } } val b = a.map { it.await() } s = b.joinToString { "" } } return s } } 

日志输出如下所示:

 2017-10-30 20:56:04.525 INFO [coroutinesDemo,eb6fd4fedb6f3a6d,eb6fd4fedb6f3a6d,true] 13547 --- [nio-8080-exec-1] cecoroutines.ConcurrentController : /concurrent1 2017-10-30 20:56:04.543 INFO [coroutinesDemo,eb6fd4fedb6f3a6d,eb6fd4fedb6f3a6d,true] 13547 --- [nio-8080-exec-1] cecoroutines.ConcurrentController : http://www.google.com 2017-10-30 20:56:04.548 INFO [coroutinesDemo,eb6fd4fedb6f3a6d,eb6fd4fedb6f3a6d,true] 13547 --- [nio-8080-exec-1] cecoroutines.ConcurrentController : http://www.facebook.com 2017-10-30 20:56:04.548 INFO [coroutinesDemo,,,] 13547 --- [onPool-worker-9] cecoroutines.ConcurrentController : getting http://www.google.com 2017-10-30 20:56:04.549 INFO [coroutinesDemo,,,] 13547 --- [onPool-worker-2] cecoroutines.ConcurrentController : getting http://www.facebook.com 2017-10-30 20:56:09.703 INFO [coroutinesDemo,,,] 13547 --- [onPool-worker-2] cecoroutines.ConcurrentController : got http://www.facebook.com 2017-10-30 20:56:09.703 INFO [coroutinesDemo,,,] 13547 --- [onPool-worker-9] cecoroutines.ConcurrentController : got http://www.google.com 

但在UI中的痕迹是独立的。

我希望这两个调用Google和Facebook的urls在调用/concurrent1端点的/concurrent1嵌套。

我怀疑这是由于执行的协程与Spring应用程序启动的线程不同,但我不知道如何在这一点上继续使用Spring Sleuth!