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 2ef5f30a3795..b0e25e91495b 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.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.SpanReporter; import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.actuate.autoconfigure.tracing.TracingProperties.Baggage.Correlation; import org.springframework.boot.actuate.autoconfigure.tracing.TracingProperties.Propagation.PropagationType; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -245,11 +246,13 @@ CorrelationScopeDecorator.Builder mdcCorrelationScopeDecoratorBuilder( 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 b1a635fc6ee9..650b7efe2494 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 818465b116a5..65f1a1b612d7 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 8c0f7f465254..66496afcd8af 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