int type = a.getValue(ZIPKIN_ANNOTATIONS.A_TYPE); if (type == -1) { span.addAnnotation(Annotation.create( a.getValue(ZIPKIN_ANNOTATIONS.A_TIMESTAMP), a.getValue(ZIPKIN_ANNOTATIONS.A_KEY),
int type = a.getValue(ZIPKIN_ANNOTATIONS.A_TYPE); if (type == -1) { span.addAnnotation(Annotation.create( a.getValue(ZIPKIN_ANNOTATIONS.A_TIMESTAMP), a.getValue(ZIPKIN_ANNOTATIONS.A_KEY),
int type = a.getValue(ZIPKIN_ANNOTATIONS.A_TYPE); if (type == -1) { span.addAnnotation(Annotation.create( a.getValue(ZIPKIN_ANNOTATIONS.A_TIMESTAMP), a.getValue(ZIPKIN_ANNOTATIONS.A_KEY),
} else { wroteEndpoint = true; result.addAnnotation(a); result.addAnnotation(a); || ms != null || mr != null) { if (cs != null) result.addAnnotation(cs); if (sr != null) result.addAnnotation(sr); if (ss != null) result.addAnnotation(ss); if (cr != null) result.addAnnotation(cr); if (ws != null) result.addAnnotation(ws); if (wr != null) result.addAnnotation(wr); if (ms != null) result.addAnnotation(ms); if (mr != null) result.addAnnotation(mr); wroteEndpoint = true; } else if (local != null && remote != null) {
int type = a.getValue(ZIPKIN_ANNOTATIONS.A_TYPE); if (type == -1) { span.addAnnotation(Annotation.create( a.getValue(ZIPKIN_ANNOTATIONS.A_TIMESTAMP), a.getValue(ZIPKIN_ANNOTATIONS.A_KEY),
reader.beginArray(); while (reader.hasNext()) { result.addAnnotation(ANNOTATION_ADAPTER.fromJson(reader));
protected zipkin.Span.Builder createNewZipkinSpanBuilderWithSpanPurposeAnnotations( Span wingtipsSpan, long startEpochMicros, long durationMicros, Endpoint zipkinEndpoint, String localComponentNamespace ) { zipkin.Span.Builder zsb = zipkin.Span.builder(); switch(wingtipsSpan.getSpanPurpose()) { case SERVER: zsb.addAnnotation(Annotation.create(startEpochMicros, Constants.SERVER_RECV, zipkinEndpoint)) .addAnnotation(Annotation.create(startEpochMicros + durationMicros, Constants.SERVER_SEND, zipkinEndpoint)); break; case CLIENT: zsb.addAnnotation(Annotation.create(startEpochMicros, Constants.CLIENT_SEND, zipkinEndpoint)) .addAnnotation(Annotation.create(startEpochMicros + durationMicros, Constants.CLIENT_RECV, zipkinEndpoint)); break; case LOCAL_ONLY: case UNKNOWN: // intentional fall-through: local and unknown span purpose are treated the same way zsb.addBinaryAnnotation(BinaryAnnotation.create(Constants.LOCAL_COMPONENT, localComponentNamespace, zipkinEndpoint)); break; default: logger.warn("Unhandled SpanPurpose type: " + wingtipsSpan.getSpanPurpose().name()); } return zsb; }
protected zipkin.Span.Builder createNewZipkinSpanBuilderWithSpanPurposeAnnotations( Span wingtipsSpan, long startEpochMicros, long durationMicros, Endpoint zipkinEndpoint, String localComponentNamespace ) { zipkin.Span.Builder zsb = zipkin.Span.builder(); switch(wingtipsSpan.getSpanPurpose()) { case SERVER: zsb.addAnnotation(Annotation.create(startEpochMicros, Constants.SERVER_RECV, zipkinEndpoint)) .addAnnotation(Annotation.create(startEpochMicros + durationMicros, Constants.SERVER_SEND, zipkinEndpoint)); break; case CLIENT: zsb.addAnnotation(Annotation.create(startEpochMicros, Constants.CLIENT_SEND, zipkinEndpoint)) .addAnnotation(Annotation.create(startEpochMicros + durationMicros, Constants.CLIENT_RECV, zipkinEndpoint)); break; case LOCAL_ONLY: case UNKNOWN: // intentional fall-through: local and unknown span purpose are treated the same way zsb.addBinaryAnnotation(BinaryAnnotation.create(Constants.LOCAL_COMPONENT, localComponentNamespace, zipkinEndpoint)); break; default: logger.warn("Unhandled SpanPurpose type: " + wingtipsSpan.getSpanPurpose().name()); } return zsb; }
protected void addAllAnnotationsToBuilder( zipkin.Span.Builder builder, List<TimestampedAnnotation> wingtipsAnnotations, Endpoint zipkinEndpoint ) { for (TimestampedAnnotation wingtipsAnnotation : wingtipsAnnotations) { builder.addAnnotation( Annotation.create( wingtipsAnnotation.getTimestampEpochMicros(), wingtipsAnnotation.getValue(), zipkinEndpoint ) ); } }
synchronized Span toSpan() { // fill in the host/service data for all the annotations for (Annotation ann : annotations) { Endpoint ep = Endpoints.boundEndpoint(ann.endpoint); span.addAnnotation( ann.toBuilder().endpoint(ep.toBuilder().serviceName(service).build()).build()); } for (BinaryAnnotation ann : binaryAnnotations) { Endpoint ep = Endpoints.boundEndpoint(ann.endpoint); // TODO: service name for "ca" or "sa" is likely incorrect span.addBinaryAnnotation( ann.toBuilder().endpoint(ep.toBuilder().serviceName(service).build()).build()); } return span.build(); }
protected void addAllAnnotationsToBuilder( zipkin.Span.Builder builder, List<TimestampedAnnotation> wingtipsAnnotations, Endpoint zipkinEndpoint ) { for (TimestampedAnnotation wingtipsAnnotation : wingtipsAnnotations) { builder.addAnnotation( Annotation.create( wingtipsAnnotation.getTimestampEpochMicros(), wingtipsAnnotation.getValue(), zipkinEndpoint ) ); } }