in geronimo-opentracing-common/src/main/java/org/apache/geronimo/microprofile/opentracing/common/microprofile/zipkin/ZipkinConverter.java [204:242]
private List<ZipkinSpan.ZipkinAnnotation> toAnnotations(final SpanImpl span) {
final Map<String, Object> tags = span.getTags();
final List<ZipkinSpan.ZipkinAnnotation> annotations = new ArrayList<>(2);
switch (String.valueOf(tags.get(Tags.SPAN_KIND.getKey()))) {
case Tags.SPAN_KIND_CLIENT: {
{
final ZipkinSpan.ZipkinAnnotation clientSend = new ZipkinSpan.ZipkinAnnotation();
clientSend.setValue("cs");
clientSend.setTimestamp(span.getTimestamp());
annotations.add(clientSend);
}
{
final ZipkinSpan.ZipkinAnnotation clientReceived = new ZipkinSpan.ZipkinAnnotation();
clientReceived.setValue("cr");
clientReceived.setTimestamp(span.getTimestamp() + span.getDuration());
annotations.add(clientReceived);
}
return annotations;
}
case Tags.SPAN_KIND_SERVER: {
{
final ZipkinSpan.ZipkinAnnotation serverReceived = new ZipkinSpan.ZipkinAnnotation();
serverReceived.setValue("sr");
serverReceived.setTimestamp(span.getTimestamp());
annotations.add(serverReceived);
}
{
final ZipkinSpan.ZipkinAnnotation serverSend = new ZipkinSpan.ZipkinAnnotation();
serverSend.setValue("ss");
serverSend.setTimestamp(span.getTimestamp() + span.getDuration());
annotations.add(serverSend);
}
return annotations;
}
default:
return emptyList();
}
}