2 sky walking application toolkit trace chn
吴晟 Wu Sheng edited this page 2017-09-17 08:13:25 +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.

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

    Download

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

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

示例代码,仅供参考

  • 对任何需要追踪的方法,使用@Trace标注,则此方法会被加入到追踪链中。