Introduce sampling logic when incoming request has only trace and span ids
without this change when there were tracing headers without sampled decision, we always exported the span. with this change if: Trace Id and Span Id are set but there is no Sampled flag - delegate sampling decision to Sampler Trace Id and Span Id and Sampled flag are set - pass the value from Sampled Flag fixes gh-1115
This commit is contained in:
@@ -25,6 +25,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.sleuth.sampler.AlwaysSampler;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
@@ -186,5 +187,9 @@ public class MessagingApplicationTests extends AbstractIntegrationTest {
|
||||
Reporter<Span> integrationTestZipkinSpanReporter() {
|
||||
return new IntegrationTestZipkinSpanReporter();
|
||||
}
|
||||
|
||||
@Bean AlwaysSampler sampler() {
|
||||
return new AlwaysSampler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user