mirror of
https://github.com/apache/skywalking.git
synced 2026-11-06 10:07:51 +00:00
3
sky walking application toolkit trace context
吴晟 Wu Sheng edited this page 2017-07-10 14:27:53 +08:00
- Dependency the toolkit, such as using maven or gradle
<dependency>
<groupId>org.skywalking</groupId>
<artifactId>apm-toolkit-trace-context</artifactId>
<version>${skywalking.version}</version>
</dependency>
- Use
TraceContext.traceId()to retrieve the tracaId in any moment and anywhere.
import org.skywalking.apm.toolkit.trace.TraceContext;
...
modelAndView.addObject("traceId", TraceContext.traceId());
sample code only