diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfiguration.java index 43006e4e1f..a52d6167e1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfiguration.java @@ -29,7 +29,7 @@ import brave.baggage.BaggagePropagation; import brave.baggage.BaggagePropagation.FactoryBuilder; import brave.baggage.BaggagePropagationConfig; import brave.baggage.BaggagePropagationCustomizer; -import brave.baggage.CorrelationScopeConfig; +import brave.baggage.CorrelationScopeConfig.SingleCorrelationField; import brave.baggage.CorrelationScopeCustomizer; import brave.baggage.CorrelationScopeDecorator; import brave.context.slf4j.MDCScopeDecorator; @@ -51,6 +51,7 @@ import io.micrometer.tracing.exporter.SpanFilter; import io.micrometer.tracing.exporter.SpanReporter; import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.actuate.autoconfigure.tracing.TracingProperties.Baggage.Correlation; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -225,11 +226,13 @@ public class BraveAutoConfiguration { matchIfMissing = true) CorrelationScopeCustomizer correlationFieldsCorrelationScopeCustomizer() { return (builder) -> { - List correlationFields = this.tracingProperties.getBaggage().getCorrelation().getFields(); - for (String field : correlationFields) { - builder.add(CorrelationScopeConfig.SingleCorrelationField.newBuilder(BaggageField.create(field)) + Correlation correlationProperties = this.tracingProperties.getBaggage().getCorrelation(); + for (String field : correlationProperties.getFields()) { + BaggageField baggageField = BaggageField.create(field); + SingleCorrelationField correlationField = SingleCorrelationField.newBuilder(baggageField) .flushOnUpdate() - .build()); + .build(); + builder.add(correlationField); } }; } diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/tracing.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/tracing.adoc index 5a1a1e4182..80e6305cd7 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/tracing.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/tracing.adoc @@ -37,7 +37,10 @@ Add the following application properties: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- - management.tracing.sampling.probability: 1.0 + management: + tracing: + sampling: + probability: 1.0 ---- By default, Spring Boot samples only 10% of requests to prevent overwhelming the trace backend. diff --git a/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/log4j2/log4j2.xml b/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/log4j2/log4j2.xml index f70d01d28b..5bcd7a322c 100644 --- a/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/log4j2/log4j2.xml +++ b/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/log4j2/log4j2.xml @@ -5,7 +5,7 @@ %5p yyyy-MM-dd'T'HH:mm:ss.SSSXXX %clr{%d{${sys:LOG_DATEFORMAT_PATTERN}}}{faint} %clr{${sys:LOG_LEVEL_PATTERN}} %clr{%pid}{magenta} %clr{---}{faint} %clr{[%15.15t]}{faint} %clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD} - %d{${LOG_DATEFORMAT_PATTERN}} ${LOG_LEVEL_PATTERN} %pid --- [%t] %-40.40c{1.} : %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD} + %d{${sys:LOG_DATEFORMAT_PATTERN}} ${sys:LOG_LEVEL_PATTERN} %pid --- [%t] %-40.40c{1.} : %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD} diff --git a/spring-boot-project/spring-boot/src/test/resources/log4j2-test.xml b/spring-boot-project/spring-boot/src/test/resources/log4j2-test.xml index 8c0f7f4652..66496afcd8 100644 --- a/spring-boot-project/spring-boot/src/test/resources/log4j2-test.xml +++ b/spring-boot-project/spring-boot/src/test/resources/log4j2-test.xml @@ -1,5 +1,5 @@ - + %xwEx %5p