@Test public void testSpanKindConsumerHasCorrectKind() { JaegerSpan span = tracer.buildSpan("operation-name").start(); Tags.SPAN_KIND.set(span, Tags.SPAN_KIND_CONSUMER); zipkin2.Span zipkinSpan = V2SpanConverter.convertSpan(span); assertEquals(zipkinSpan.kind(), zipkin2.Span.Kind.CONSUMER); }
public static zipkin2.Span convertSpan(JaegerSpan span) { JaegerTracer tracer = span.getTracer(); zipkin2.Endpoint.Builder host = zipkin2.Endpoint.newBuilder() .serviceName(tracer.getServiceName()); if (tracer.getIpv4() != 0) { host.parseIp(convertIp(tracer.getIpv4())); } zipkin2.Endpoint peerEndpoint = extractPeerEndpoint(span.getTags()); JaegerSpanContext context = span.context(); zipkin2.Span.Builder builder = zipkin2.Span.newBuilder() .id(Long.toHexString(context.getSpanId())) .traceId(context.getTraceIdHigh(), context.getTraceIdLow()) .name(span.getOperationName()) .parentId(Long.toHexString(context.getParentId())) .debug(context.isDebug()) .localEndpoint(host.build()) .remoteEndpoint(peerEndpoint) .kind(convertKind(span.getTags().get(Tags.SPAN_KIND.getKey()))) .timestamp(span.getStart()) .duration(span.getDuration()); buildAnnotations(span, builder); buildTags(span, builder); return builder.build(); }
V2SpanConverter { public static zipkin2.Span convertSpan(JaegerSpan span) { JaegerTracer tracer = span.getTracer(); zipkin2.Endpoint.Builder host = zipkin2.Endpoint.newBuilder() .serviceName(tracer.getServiceName()); if (tracer.getIpv4() != 0) { host.parseIp(convertIp(tracer.getIpv4())); } zipkin2.Endpoint peerEndpoint = extractPeerEndpoint(span.getTags()); JaegerSpanContext context = span.context(); zipkin2.Span.Builder builder = zipkin2.Span.newBuilder() .id(Long.toHexString(context.getSpanId())) .traceId(context.getTraceIdHigh(), context.getTraceIdLow()) .name(span.getOperationName()) .parentId(Long.toHexString(context.getParentId())) .debug(context.isDebug()) .localEndpoint(host.build()) .remoteEndpoint(peerEndpoint) .kind(convertKind(span.getTags().get(Tags.SPAN_KIND.getKey()))) .timestamp(span.getStart()) .duration(span.getDuration()); buildAnnotations(span, builder); buildTags(span, builder); return builder.build(); } }
V2SpanConverter { public static zipkin2.Span convertSpan(JaegerSpan span) { JaegerTracer tracer = span.getTracer(); zipkin2.Endpoint.Builder host = zipkin2.Endpoint.newBuilder() .serviceName(tracer.getServiceName()); if (tracer.getIpv4() != 0) { host.parseIp(convertIp(tracer.getIpv4())); } zipkin2.Endpoint peerEndpoint = extractPeerEndpoint(span.getTags()); JaegerSpanContext context = span.context(); zipkin2.Span.Builder builder = zipkin2.Span.newBuilder() .id(Long.toHexString(context.getSpanId())) .traceId(context.getTraceIdHigh(), context.getTraceIdLow()) .name(span.getOperationName()) .parentId(Long.toHexString(context.getParentId())) .debug(context.isDebug()) .localEndpoint(host.build()) .remoteEndpoint(peerEndpoint) .kind(convertKind(span.getTags().get(Tags.SPAN_KIND.getKey()))) .timestamp(span.getStart()) .duration(span.getDuration()); buildAnnotations(span, builder); buildTags(span, builder); return builder.build(); }  }
V2SpanConverter { public static zipkin2.Span convertSpan(JaegerSpan span) { JaegerTracer tracer = span.getTracer(); zipkin2.Endpoint.Builder host = zipkin2.Endpoint.newBuilder() .serviceName(tracer.getServiceName()); if (tracer.getIpv4() != 0) { host.parseIp(convertIp(tracer.getIpv4())); } zipkin2.Endpoint peerEndpoint = extractPeerEndpoint(span.getTags()); JaegerSpanContext context = span.context(); zipkin2.Span.Builder builder = zipkin2.Span.newBuilder() .id(Long.toHexString(context.getSpanId())) .traceId(context.getTraceIdHigh(), context.getTraceIdLow()) .name(span.getOperationName()) .parentId(Long.toHexString(context.getParentId())) .debug(context.isDebug()) .localEndpoint(host.build()) .remoteEndpoint(peerEndpoint) .kind(convertKind(span.getTags().get(Tags.SPAN_KIND.getKey()))) .timestamp(span.getStart()) .duration(span.getDuration()); buildAnnotations(span, builder); buildTags(span, builder); return builder.build(); }  static zipkin2.Span convertSpan(JaegerSpan span); static zipkin2.Endpoint extractPeerEndpoint(Map<String, Object> tags); }
V2SpanConverter { public static zipkin2.Span convertSpan(JaegerSpan span) { JaegerTracer tracer = span.getTracer(); zipkin2.Endpoint.Builder host = zipkin2.Endpoint.newBuilder() .serviceName(tracer.getServiceName()); if (tracer.getIpv4() != 0) { host.parseIp(convertIp(tracer.getIpv4())); } zipkin2.Endpoint peerEndpoint = extractPeerEndpoint(span.getTags()); JaegerSpanContext context = span.context(); zipkin2.Span.Builder builder = zipkin2.Span.newBuilder() .id(Long.toHexString(context.getSpanId())) .traceId(context.getTraceIdHigh(), context.getTraceIdLow()) .name(span.getOperationName()) .parentId(Long.toHexString(context.getParentId())) .debug(context.isDebug()) .localEndpoint(host.build()) .remoteEndpoint(peerEndpoint) .kind(convertKind(span.getTags().get(Tags.SPAN_KIND.getKey()))) .timestamp(span.getStart()) .duration(span.getDuration()); buildAnnotations(span, builder); buildTags(span, builder); return builder.build(); }  static zipkin2.Span convertSpan(JaegerSpan span); static zipkin2.Endpoint extractPeerEndpoint(Map<String, Object> tags);  }