All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.icodegarden.nutrient.lang.trace.SkywalkingTraceCtx Maven / Gradle / Ivy

There is a newer version: 3.0.2
Show newest version
package io.github.icodegarden.nutrient.lang.trace;

import java.util.concurrent.Callable;

import org.apache.skywalking.apm.toolkit.trace.ActiveSpan;
import org.apache.skywalking.apm.toolkit.trace.CallableWrapper;
import org.apache.skywalking.apm.toolkit.trace.RunnableWrapper;
import org.apache.skywalking.apm.toolkit.trace.TraceContext;

/**
 * 
 * @author Fangfang.Xu
 *
 */
public class SkywalkingTraceCtx extends TraceCtx {

	@Override
	public String traceId() {
		return TraceContext.traceId();
	}

	@Override
	public String spanId() {
		return Integer.toString(TraceContext.spanId());
	}

	@Override
	public String segmentId() {
		return TraceContext.segmentId();
	}

	@Override
	public void tag(String key, String value) {
		ActiveSpan.tag(key, value);
	}

	@Override
	public void putCorrelation(String key, String value) {
		TraceContext.putCorrelation(key, value);
	}

	@Override
	public Runnable traceRunnable(Runnable r) {
		return RunnableWrapper.of(r);
	}

	@Override
	public  Callable traceCallable(Callable c) {
		return CallableWrapper.of(c);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy