Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 如何在Sleuth版本2.0.4中使用java检索spanid_Spring Boot_Trace_Spring Cloud Sleuth_Zipkin - Fatal编程技术网

Spring boot 如何在Sleuth版本2.0.4中使用java检索spanid

Spring boot 如何在Sleuth版本2.0.4中使用java检索spanid,spring-boot,trace,spring-cloud-sleuth,zipkin,Spring Boot,Trace,Spring Cloud Sleuth,Zipkin,我需要知道java代码中的SpandId,但我不知道如何获得它。我一直在搜索,发现很多人都提到Tracer类,但它在sleuth 2.0.4中不可用 有人知道如何使用sleuth 2.0.4获得斯潘迪德吗 谢谢 只需注入brave.Tracerbean,然后就可以调用Tracer.currentSpan().context().spanId()或Tracer.currentSpan().context().spanIdString()

我需要知道java代码中的SpandId,但我不知道如何获得它。我一直在搜索,发现很多人都提到Tracer类,但它在sleuth 2.0.4中不可用

有人知道如何使用sleuth 2.0.4获得斯潘迪德吗


谢谢

只需注入
brave.Tracer
bean,然后就可以调用
Tracer.currentSpan().context().spanId()
Tracer.currentSpan().context().spanIdString()