use of org.apache.skywalking.apm.toolkit.opentracing.SkywalkingSpanBuilder in project incubator-skywalking by apache.
the class ConstructorWithSpanBuilderInterceptor method onConstruct.
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
SkywalkingSpanBuilder spanBuilder = (SkywalkingSpanBuilder) allArguments[0];
AbstractSpan span;
if (spanBuilder.isEntry()) {
span = ContextManager.createEntrySpan(spanBuilder.getOperationName(), null);
} else if (spanBuilder.isExit() && (!StringUtil.isEmpty(spanBuilder.getPeer()))) {
span = ContextManager.createExitSpan(spanBuilder.getOperationName(), buildRemotePeer(spanBuilder));
} else {
span = ContextManager.createLocalSpan(spanBuilder.getOperationName());
}
for (Tag tag : spanBuilder.getTags()) {
span.tag(tag.getKey(), tag.getValue());
}
span.setComponent(spanBuilder.getComponentName());
if (spanBuilder.isError()) {
span.errorOccurred();
}
objInst.setSkyWalkingDynamicField(span);
}
use of org.apache.skywalking.apm.toolkit.opentracing.SkywalkingSpanBuilder in project incubator-skywalking by apache.
the class SkywalkingSpanActivationTest method setUp.
@Before
public void setUp() {
spanBuilder = new SkywalkingSpanBuilder("test").withTag(Tags.COMPONENT.getKey(), "test");
constructorWithSpanBuilderInterceptor = new ConstructorWithSpanBuilderInterceptor();
spanLogInterceptor = new SpanLogInterceptor();
logArgument = new Object[] { 111111111L, event };
logArgumentType = new Class[] { long.class, HashMap.class };
setOperationNameInterceptor = new SpanSetOperationNameInterceptor();
setOperationNameArgument = new Object[] { "testOperationName" };
setOperationNameArgumentType = new Class[] { String.class };
spanFinishInterceptor = new SpanFinishInterceptor();
injectInterceptor = new SkywalkingTracerInjectInterceptor();
extractInterceptor = new SkywalkingTracerExtractInterceptor();
constructorInterceptor = new ConstructorInterceptor();
activateInterceptor = new ActivateInterceptor();
}
Aggregations