diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/trace/TraceWebFilterAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/trace/TraceWebFilterAutoConfiguration.java index 57f029901d9..ea3685c4c97 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/trace/TraceWebFilterAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/trace/TraceWebFilterAutoConfiguration.java @@ -45,7 +45,7 @@ import org.springframework.web.servlet.DispatcherServlet; @Configuration @ConditionalOnClass({ Servlet.class, DispatcherServlet.class, ServletRegistration.class }) @AutoConfigureAfter(TraceRepositoryAutoConfiguration.class) -@ConditionalOnProperty(prefix = "endpoints.trace.filter", name = "enabled", matchIfMissing = true) +@ConditionalOnProperty(prefix = "management.trace.filter", name = "enabled", matchIfMissing = true) @EnableConfigurationProperties(TraceProperties.class) public class TraceWebFilterAutoConfiguration { diff --git a/spring-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json index e71808c2ea6..be6e4fc8071 100644 --- a/spring-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -73,10 +73,14 @@ } }, { - "name": "endpoints.trace.filter.enabled", - "type": "java.lang.Boolean", - "description": "Enable the trace servlet filter.", - "defaultValue": true + "name": "endpoints.trace.filter.enabled", + "type": "java.lang.Boolean", + "description": "Enable the trace servlet filter.", + "defaultValue": true, + "deprecation": { + "replacement": "management.trace.filter.enabled", + "level": "error" + } }, { "name": "info", @@ -217,6 +221,12 @@ "name": "management.security.sessions", "defaultValue": "stateless" }, + { + "name": "management.trace.filter.enabled", + "type": "java.lang.Boolean", + "description": "Enable the trace servlet filter.", + "defaultValue": true + }, { "name": "spring.git.properties", "type": "java.lang.String", diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/trace/TraceWebFilterAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/trace/TraceWebFilterAutoConfigurationTests.java index b2b9c3f9b2b..a5cc306c586 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/trace/TraceWebFilterAutoConfigurationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/trace/TraceWebFilterAutoConfigurationTests.java @@ -64,7 +64,7 @@ public class TraceWebFilterAutoConfigurationTests { @Test public void skipsFilterIfPropertyDisabled() throws Exception { - load("endpoints.trace.filter.enabled:false"); + load("management.trace.filter.enabled:false"); assertThat(this.context.getBeansOfType(WebRequestTraceFilter.class).size()) .isEqualTo(0); } diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 8b065df5c26..12874db5b73 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -1195,7 +1195,6 @@ content into your application; rather pick only the properties that you need. # TRACE ENDPOINT ({sc-spring-boot-actuator}/endpoint/TraceEndpoint.{sc-ext}[TraceEndpoint]) endpoints.trace.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached. endpoints.trace.enabled=true # Enable the trace endpoint. - endpoints.trace.filter.enabled=true # Enable the trace servlet filter. endpoints.trace.jmx.enabled=true # Expose the trace endpoint as a JMX MBean. endpoints.trace.web.enabled=false # Expose the trace endpoint as a Web endpoint. @@ -1280,6 +1279,7 @@ content into your application; rather pick only the properties that you need. management.metrics.filter.gauge-submissions= # Submissions that should be made to the gauge. # TRACING ({sc-spring-boot-actuator}/trace/TraceProperties.{sc-ext}[TraceProperties]) + management.trace.filter.enabled=true # Enable the trace servlet filter. management.trace.include=request-headers,response-headers,cookies,errors # Items to be included in the trace. # METRICS EXPORT ({sc-spring-boot-actuator}/metrics/export/MetricExportProperties.{sc-ext}[MetricExportProperties])