@Test public void testSpanKindServerCreatesAnnotations() { JaegerSpan span = tracer.buildSpan("operation-name").start(); Tags.SPAN_KIND.set(span, Tags.SPAN_KIND_SERVER); com.twitter.zipkin.thriftjava.Span zipkinSpan = ThriftSpanConverter.convertSpan(span); List<Annotation> annotations = zipkinSpan.getAnnotations(); boolean serverReceiveFound = false; boolean serverSendFound = false; for (Annotation anno : annotations) { if (anno.getValue().equals(zipkincoreConstants.SERVER_RECV)) { serverReceiveFound = true; } if (anno.getValue().equals(zipkincoreConstants.SERVER_SEND)) { serverSendFound = true; } } assertTrue(serverReceiveFound); assertTrue(serverSendFound); }
public static com.twitter.zipkin.thriftjava.Span convertSpan(JaegerSpan jaegerSpan) { JaegerTracer tracer = jaegerSpan.getTracer(); Endpoint host = new Endpoint(tracer.getIpv4(), (short) 0, tracer.getServiceName()); JaegerSpanContext context = jaegerSpan.context(); return new com.twitter.zipkin.thriftjava.Span( context.getTraceIdLow(), jaegerSpan.getOperationName(), context.getSpanId(), buildAnnotations(jaegerSpan, host), buildBinaryAnnotations(jaegerSpan, host)) .setParent_id(context.getParentId()) .setTrace_id_high(context.getTraceIdHigh()) .setDebug(context.isDebug()) .setTimestamp(jaegerSpan.getStart()) .setDuration(jaegerSpan.getDuration()); }
ThriftSpanConverter { public static com.twitter.zipkin.thriftjava.Span convertSpan(JaegerSpan jaegerSpan) { JaegerTracer tracer = jaegerSpan.getTracer(); Endpoint host = new Endpoint(tracer.getIpv4(), (short) 0, tracer.getServiceName()); JaegerSpanContext context = jaegerSpan.context(); return new com.twitter.zipkin.thriftjava.Span( context.getTraceIdLow(), jaegerSpan.getOperationName(), context.getSpanId(), buildAnnotations(jaegerSpan, host), buildBinaryAnnotations(jaegerSpan, host)) .setParent_id(context.getParentId()) .setTrace_id_high(context.getTraceIdHigh()) .setDebug(context.isDebug()) .setTimestamp(jaegerSpan.getStart()) .setDuration(jaegerSpan.getDuration()); } }
ThriftSpanConverter { public static com.twitter.zipkin.thriftjava.Span convertSpan(JaegerSpan jaegerSpan) { JaegerTracer tracer = jaegerSpan.getTracer(); Endpoint host = new Endpoint(tracer.getIpv4(), (short) 0, tracer.getServiceName()); JaegerSpanContext context = jaegerSpan.context(); return new com.twitter.zipkin.thriftjava.Span( context.getTraceIdLow(), jaegerSpan.getOperationName(), context.getSpanId(), buildAnnotations(jaegerSpan, host), buildBinaryAnnotations(jaegerSpan, host)) .setParent_id(context.getParentId()) .setTrace_id_high(context.getTraceIdHigh()) .setDebug(context.isDebug()) .setTimestamp(jaegerSpan.getStart()) .setDuration(jaegerSpan.getDuration()); }  }
ThriftSpanConverter { public static com.twitter.zipkin.thriftjava.Span convertSpan(JaegerSpan jaegerSpan) { JaegerTracer tracer = jaegerSpan.getTracer(); Endpoint host = new Endpoint(tracer.getIpv4(), (short) 0, tracer.getServiceName()); JaegerSpanContext context = jaegerSpan.context(); return new com.twitter.zipkin.thriftjava.Span( context.getTraceIdLow(), jaegerSpan.getOperationName(), context.getSpanId(), buildAnnotations(jaegerSpan, host), buildBinaryAnnotations(jaegerSpan, host)) .setParent_id(context.getParentId()) .setTrace_id_high(context.getTraceIdHigh()) .setDebug(context.isDebug()) .setTimestamp(jaegerSpan.getStart()) .setDuration(jaegerSpan.getDuration()); }  static com.twitter.zipkin.thriftjava.Span convertSpan(JaegerSpan jaegerSpan); static Endpoint extractPeerEndpoint(Map<String, Object> tags); }
ThriftSpanConverter { public static com.twitter.zipkin.thriftjava.Span convertSpan(JaegerSpan jaegerSpan) { JaegerTracer tracer = jaegerSpan.getTracer(); Endpoint host = new Endpoint(tracer.getIpv4(), (short) 0, tracer.getServiceName()); JaegerSpanContext context = jaegerSpan.context(); return new com.twitter.zipkin.thriftjava.Span( context.getTraceIdLow(), jaegerSpan.getOperationName(), context.getSpanId(), buildAnnotations(jaegerSpan, host), buildBinaryAnnotations(jaegerSpan, host)) .setParent_id(context.getParentId()) .setTrace_id_high(context.getTraceIdHigh()) .setDebug(context.isDebug()) .setTimestamp(jaegerSpan.getStart()) .setDuration(jaegerSpan.getDuration()); }  static com.twitter.zipkin.thriftjava.Span convertSpan(JaegerSpan jaegerSpan); static Endpoint extractPeerEndpoint(Map<String, Object> tags);  }