Bumping versions
This commit is contained in:
@@ -43,6 +43,9 @@
|
||||
|spring.sleuth.sampler.refresh.enabled | true | Enable refresh scope for sampler.
|
||||
|spring.sleuth.scheduled.enabled | true | Enable tracing for {@link org.springframework.scheduling.annotation.Scheduled}.
|
||||
|spring.sleuth.scheduled.skip-pattern | | Pattern for the fully qualified name of a class that should be skipped.
|
||||
|spring.sleuth.span-handler.additional-span-name-patterns-to-ignore | | Additional list of span names to ignore. Will be appended to {@link #spanNamePatternsToSkip}.
|
||||
|spring.sleuth.span-handler.enabled | false | Will turn on the default Sleuth handler mechanism. Might ignore exporting of certain spans;
|
||||
|spring.sleuth.span-handler.span-name-patterns-to-skip | ^catalogWatchTaskScheduler$ | List of span names to ignore. They will not be sent to external systems.
|
||||
|spring.sleuth.supports-join | true | True means the tracing system supports sharing a span ID between a client and server.
|
||||
|spring.sleuth.trace-id128 | false | When true, generate 128-bit trace IDs instead of 64-bit ones.
|
||||
|spring.sleuth.web.additional-skip-pattern | | Additional pattern for URLs that should be skipped in tracing. This will be appended to the {@link SleuthWebProperties#skipPattern}.
|
||||
|
||||
@@ -143,7 +143,8 @@ public class TraceAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(value = "spring.sleuth.span-handler.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.span-handler.enabled",
|
||||
matchIfMissing = true)
|
||||
SpanHandler spanIgnoringSpanHandler(SleuthProperties sleuthProperties) {
|
||||
return new SpanIgnoringSpanHandler(sleuthProperties);
|
||||
}
|
||||
|
||||
@@ -33,21 +33,24 @@ class SpanIgnoringSpanHandlerTests {
|
||||
|
||||
@Test
|
||||
void should_handle_span_when_not_yet_finished() {
|
||||
SpanIgnoringSpanHandler handler = new SpanIgnoringSpanHandler(new SleuthProperties());
|
||||
SpanIgnoringSpanHandler handler = new SpanIgnoringSpanHandler(
|
||||
new SleuthProperties());
|
||||
|
||||
then(handler.end(null, null, SpanHandler.Cause.ABANDONED)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void should_handle_span_when_name_null() {
|
||||
SpanIgnoringSpanHandler handler = new SpanIgnoringSpanHandler(new SleuthProperties());
|
||||
SpanIgnoringSpanHandler handler = new SpanIgnoringSpanHandler(
|
||||
new SleuthProperties());
|
||||
|
||||
then(handler.end(null, new MutableSpan(), SpanHandler.Cause.FINISHED)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void should_handle_span_when_not_present_in_main_list_of_spans_to_skip() {
|
||||
SpanIgnoringSpanHandler handler = new SpanIgnoringSpanHandler(new SleuthProperties());
|
||||
SpanIgnoringSpanHandler handler = new SpanIgnoringSpanHandler(
|
||||
new SleuthProperties());
|
||||
|
||||
then(handler.end(null, namedSpan(), SpanHandler.Cause.FINISHED)).isTrue();
|
||||
}
|
||||
@@ -61,7 +64,8 @@ class SpanIgnoringSpanHandlerTests {
|
||||
@Test
|
||||
void should_not_handle_span_when_present_in_main_list_of_spans_to_skip() {
|
||||
SleuthProperties sleuthProperties = new SleuthProperties();
|
||||
sleuthProperties.getSpanHandler().setSpanNamePatternsToSkip(Collections.singletonList("someName"));
|
||||
sleuthProperties.getSpanHandler()
|
||||
.setSpanNamePatternsToSkip(Collections.singletonList("someName"));
|
||||
SpanIgnoringSpanHandler handler = new SpanIgnoringSpanHandler(sleuthProperties);
|
||||
|
||||
then(handler.end(null, namedSpan(), SpanHandler.Cause.FINISHED)).isFalse();
|
||||
@@ -87,8 +91,8 @@ class SpanIgnoringSpanHandlerTests {
|
||||
end(handler(sleuthPropertiesWithAdditionalEntries("b")));
|
||||
end(handler(sleuthPropertiesWithAdditionalEntries("c")));
|
||||
|
||||
then(SpanIgnoringSpanHandler.cache).containsKey("someOtherName").containsKey("a").containsKey("b")
|
||||
.containsKey("c");
|
||||
then(SpanIgnoringSpanHandler.cache).containsKey("someOtherName").containsKey("a")
|
||||
.containsKey("b").containsKey("c");
|
||||
}
|
||||
|
||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
@@ -97,13 +101,16 @@ class SpanIgnoringSpanHandlerTests {
|
||||
@Test
|
||||
void should_not_register_span_handler_when_property_passed() {
|
||||
this.contextRunner.withPropertyValues("spring.sleuth.span-handler.enabled=false")
|
||||
.run((context) -> BDDAssertions.thenThrownBy(() -> context.getBean(SpanIgnoringSpanHandler.class))
|
||||
.run((context) -> BDDAssertions
|
||||
.thenThrownBy(
|
||||
() -> context.getBean(SpanIgnoringSpanHandler.class))
|
||||
.isInstanceOf(NoSuchBeanDefinitionException.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void should_register_span_handler_by_default() {
|
||||
this.contextRunner.run((context) -> context.getBean(SpanIgnoringSpanHandler.class));
|
||||
this.contextRunner
|
||||
.run((context) -> context.getBean(SpanIgnoringSpanHandler.class));
|
||||
}
|
||||
|
||||
private SleuthProperties sleuthPropertiesWithAdditionalEntries() {
|
||||
@@ -112,7 +119,8 @@ class SpanIgnoringSpanHandlerTests {
|
||||
|
||||
private SleuthProperties sleuthPropertiesWithAdditionalEntries(String name) {
|
||||
SleuthProperties sleuthProperties = new SleuthProperties();
|
||||
sleuthProperties.getSpanHandler().setAdditionalSpanNamePatternsToIgnore(Collections.singletonList(name));
|
||||
sleuthProperties.getSpanHandler()
|
||||
.setAdditionalSpanNamePatternsToIgnore(Collections.singletonList(name));
|
||||
return sleuthProperties;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user