3 sky walking application toolkit trace context chn
吴晟 Wu Sheng edited this page 2017-09-16 21:51:43 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

3.2版本起合并到apm-toolkit-trace中

  • 使用 maven 和 gradle 依赖相应的工具包
   <dependency>
      <groupId>org.skywalking</groupId>
      <artifactId>apm-toolkit-trace-context</artifactId>
      <version>${skywalking.version}</version>
   </dependency>

    Download

  • 随时使用 TraceContext.traceId() API,在应用程序的任何地方获取traceId.
import org.skywalking.apm.toolkit.trace.TraceContext;
...

modelAndView.addObject("traceId", TraceContext.traceId());

示例代码,仅供参考