Merged 1.2.x to master
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user