skywalking-java/docs/cn/Application-toolkit-trace-C...

20 lines
812 B
Markdown
Raw Blame History

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 依赖相应的工具包
```xml
<dependency>
<groupId>org.skywalking</groupId>
<artifactId>apm-toolkit-trace</artifactId>
<version>${skywalking.version}</version>
</dependency>
```
&nbsp;&nbsp;&nbsp;[ ![Download](https://api.bintray.com/packages/wu-sheng/skywalking/org.skywalking.apm-toolkit-trace/images/download.svg) ](https://bintray.com/wu-sheng/skywalking/org.skywalking.apm-toolkit-trace/_latestVersion)
* 随时使用 `TraceContext.traceId()` API在应用程序的任何地方获取traceId.
```java
import org.skywalking.apm.toolkit.trace.TraceContext;
...
modelAndView.addObject("traceId", TraceContext.traceId());
```
_示例代码仅供参考_
* 对任何需要追踪的方法,使用@Trace标注则此方法会被加入到追踪链中。