Prefers the word event when adding to a Span's timeline

Span.logs are really timestamped events. This clarifies the naming and
documentation around that.
This commit is contained in:
Adrian Cole
2016-01-25 11:18:36 +01:00
parent 763d2d027c
commit ef7e70dde3
8 changed files with 40 additions and 28 deletions

View File

@@ -106,8 +106,8 @@ public class ZipkinMessageListener {
for (Log ta : span.logs()) {
Annotation zipkinAnnotation = new Annotation.Builder()
.endpoint(endpoint)
.timestamp(ta.getTime() * 1000) // Zipkin is in microseconds
.value(ta.getMsg())
.timestamp(ta.getTimestamp() * 1000) // Zipkin is in microseconds
.value(ta.getEvent())
.build();
zipkinSpan.addAnnotation(zipkinAnnotation);
}

View File

@@ -36,7 +36,7 @@ public class ZipkinMessageListenerTests {
@Test
public void convertsTimestampAndDurationToMicroseconds() {
long start = System.currentTimeMillis();
this.span.log("hystrix/retry"); // System.currentTimeMillis
this.span.logEvent("hystrix/retry"); // System.currentTimeMillis
zipkin.Span result = ZipkinMessageListener.convert(this.span, this.host);
@@ -52,7 +52,7 @@ public class ZipkinMessageListenerTests {
/** Sleuth host corresponds to annotation/binaryAnnotation.host in zipkin. */
@Test
public void annotationsIncludeHost() {
this.span.log("hystrix/retry");
this.span.logEvent("hystrix/retry");
this.span.tag("spring-boot/version", "1.3.1.RELEASE");
zipkin.Span result = ZipkinMessageListener.convert(this.span, this.host);