@Test public void testExpectedLocalComponentNameUsed() { String expectedComponentName = "local-name"; JaegerSpan span = tracer.buildSpan("operation-name").start(); Tags.COMPONENT.set(span, expectedComponentName); com.twitter.zipkin.thriftjava.Span zipkinSpan = ThriftSpanConverter.convertSpan(span); String actualComponent = new String(zipkinSpan.getBinary_annotations().get(3).getValue(), StandardCharsets.UTF_8); assertEquals(expectedComponentName, actualComponent); }
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);  }