Merged 1.2.x to master

This commit is contained in:
Marcin Grzejszczak
2017-10-19 13:49:29 +02:00
parent 1aa30eda5e
commit 5bdc64ab6c
3 changed files with 9 additions and 4 deletions

View File

@@ -232,6 +232,7 @@ public class DefaultTracerTests {
tracer.close(span);
}
/**
* To support conversion to Amazon trace IDs, the first 32 bits of the trace ID are epoch seconds.
*/

View File

@@ -18,6 +18,7 @@ package org.springframework.cloud.sleuth.zipkin;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -87,7 +88,7 @@ public class ZipkinSpanListener implements SpanReporter {
//TODO: Consider adding support for the debug flag (related to #496)
Span convertedSpan = span;
for (SpanAdjuster adjuster : this.spanAdjusters) {
convertedSpan = adjuster.adjust(span);
convertedSpan = adjuster.adjust(convertedSpan);
}
zipkin.Span.Builder zipkinSpan = zipkin.Span.builder();
Endpoint endpoint = this.endpointLocator.local();

View File

@@ -24,6 +24,7 @@ import zipkin.Constants;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -311,12 +312,14 @@ public class ZipkinSpanListenerTests {
public void should_adjust_span_before_reporting_it() {
this.parent.logEvent(Span.CLIENT_RECV);
ZipkinSpanListener spanListener = new ZipkinSpanListener(this.spanReporter,
this.endpointLocator, null, Collections.<SpanAdjuster>singletonList(
span -> Span.builder().from(span).name("foo").build()));
this.endpointLocator, null, Arrays.asList(
(SpanAdjuster) span -> Span.builder().from(span).name("foo").build(),
(SpanAdjuster) span -> Span.builder().from(span).name(span.getName() + "bar").build()
));
zipkin.Span result = spanListener.convert(this.parent);
assertThat(result.name).isEqualTo("foo");
assertThat(result.name).isEqualTo("foobar");
}
@Test