From 1a8c7f83c4a1b9eccd8c8daf726466453cbb5e34 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 28 Aug 2020 05:30:17 +0000 Subject: [PATCH] Bumping versions --- docs/src/main/asciidoc/_configprops.adoc | 3 +++ .../autoconfig/TraceAutoConfiguration.java | 3 ++- .../SpanIgnoringSpanHandlerTests.java | 26 ++++++++++++------- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/docs/src/main/asciidoc/_configprops.adoc b/docs/src/main/asciidoc/_configprops.adoc index a1e5ff2d8..b2d5c2df9 100644 --- a/docs/src/main/asciidoc/_configprops.adoc +++ b/docs/src/main/asciidoc/_configprops.adoc @@ -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}. diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/autoconfig/TraceAutoConfiguration.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/autoconfig/TraceAutoConfiguration.java index 92e9b2413..ae3ff3064 100644 --- a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/autoconfig/TraceAutoConfiguration.java +++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/autoconfig/TraceAutoConfiguration.java @@ -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); } diff --git a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/autoconfig/SpanIgnoringSpanHandlerTests.java b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/autoconfig/SpanIgnoringSpanHandlerTests.java index 4e19d9450..a94ee1764 100644 --- a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/autoconfig/SpanIgnoringSpanHandlerTests.java +++ b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/autoconfig/SpanIgnoringSpanHandlerTests.java @@ -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; }