Move endpoints.metrics.filter to management.metrics.filter

See gh-10007
pull/10107/head
Stephane Nicoll 7 years ago
parent 4c7088981f
commit 54781c73b5

@ -48,7 +48,7 @@ import org.springframework.web.servlet.HandlerMapping;
@ConditionalOnClass({ Servlet.class, ServletRegistration.class,
OncePerRequestFilter.class, HandlerMapping.class })
@AutoConfigureAfter(MetricRepositoryAutoConfiguration.class)
@ConditionalOnProperty(prefix = "endpoints.metrics.filter", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.filter", name = "enabled", matchIfMissing = true)
@EnableConfigurationProperties({ MetricFilterProperties.class })
public class MetricFilterAutoConfiguration {

@ -31,7 +31,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @author Phillip Webb
* @since 2.0.0
*/
@ConfigurationProperties(prefix = "endpoints.metrics.filter")
@ConfigurationProperties(prefix = "management.metrics.filter")
public class MetricFilterProperties {
/**

@ -45,11 +45,32 @@
"vcap_services"
]
},
{
"name": "endpoints.metrics.filter.counter-submissions",
"type": "java.util.Set<org.springframework.boot.actuate.metrics.web.servlet.MetricsFilterSubmission>",
"description": "Submissions that should be made to the counter.",
"deprecation": {
"replacement": "management.metrics.filter.counter-submissions",
"level": "error"
}
},
{
"name": "endpoints.metrics.filter.enabled",
"type": "java.lang.Boolean",
"description": "Enable the metrics servlet filter.",
"defaultValue": true
"deprecation": {
"replacement": "management.metrics.filter.enabled",
"level": "error"
}
},
{
"name": "endpoints.metrics.filter.gauge-submissions",
"type": "java.util.Set<org.springframework.boot.actuate.metrics.web.servlet.MetricsFilterSubmission>",
"description": "Submissions that should be made to the gauge.",
"deprecation": {
"replacement": "management.metrics.filter.gauge-submissions",
"level": "error"
}
},
{
"name": "endpoints.trace.filter.enabled",
@ -186,6 +207,12 @@
"name": "management.info.git.mode",
"defaultValue": "simple"
},
{
"name": "management.metrics.filter.enabled",
"type": "java.lang.Boolean",
"description": "Enable the metrics servlet filter.",
"defaultValue": true
},
{
"name": "management.security.sessions",
"defaultValue": "stateless"

@ -236,7 +236,7 @@ public class MetricFilterAutoConfigurationTests {
@Test
public void skipsFilterIfPropertyDisabled() throws Exception {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
TestPropertyValues.of("endpoints.metrics.filter.enabled:false").applyTo(context);
TestPropertyValues.of("management.metrics.filter.enabled:false").applyTo(context);
context.register(Config.class, MetricFilterAutoConfiguration.class);
context.refresh();
assertThat(context.getBeansOfType(Filter.class).size()).isEqualTo(0);
@ -357,8 +357,8 @@ public class MetricFilterAutoConfigurationTests {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.register(Config.class, MetricFilterAutoConfiguration.class);
TestPropertyValues
.of("endpoints.metrics.filter.gauge-submissions=merged,per-http-method",
"endpoints.metrics.filter.counter-submissions=merged,per-http-method")
.of("management.metrics.filter.gauge-submissions=merged,per-http-method",
"management.metrics.filter.counter-submissions=merged,per-http-method")
.applyTo(context);
context.refresh();
Filter filter = context.getBean(Filter.class);
@ -385,8 +385,8 @@ public class MetricFilterAutoConfigurationTests {
public void doesNotRecordRolledUpMetricsIfConfigured() throws Exception {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.register(Config.class, MetricFilterAutoConfiguration.class);
TestPropertyValues.of("endpoints.metrics.filter.gauge-submissions=",
"endpoints.metrics.filter.counter-submissions=").applyTo(context);
TestPropertyValues.of("management.metrics.filter.gauge-submissions=",
"management.metrics.filter.counter-submissions=").applyTo(context);
context.refresh();
Filter filter = context.getBean(Filter.class);
MockHttpServletRequest request = new MockHttpServletRequest("PUT", "/test/path");

@ -1173,9 +1173,6 @@ content into your application; rather pick only the properties that you need.
endpoints.metrics.enabled=true # Enable the metrics endpoint.
endpoints.metrics.jmx.enabled=true # Expose the metrics endpoint as a JMX MBean.
endpoints.metrics.web.enabled=false # Expose the metrics endpoint as a Web endpoint.
endpoints.metrics.filter.counter-submissions= # Submissions that should be made to the counter.
endpoints.metrics.filter.enabled=true # Enable the metrics servlet filter.
endpoints.metrics.filter.gauge-submissions= # Submissions that should be made to the gauge.
# SHUTDOWN ENDPOINT ({sc-spring-boot-actuator}/endpoint/ShutdownEndpoint.{sc-ext}[ShutdownEndpoint])
endpoints.shutdown.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached.
@ -1277,6 +1274,11 @@ content into your application; rather pick only the properties that you need.
management.jolokia.enabled=false # Enable Jolokia.
management.jolokia.path=/jolokia # Path at which Jolokia will be available.
# METRICS FILTER ({sc-spring-boot-actuator}/autoconfigure/metrics/MetricsFilterProperties.{sc-ext}[MetricsFilterProperties])
management.metrics.filter.counter-submissions= # Submissions that should be made to the counter.
management.metrics.filter.enabled=true # Enable the metrics servlet filter.
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.include=request-headers,response-headers,cookies,errors # Items to be included in the trace.

Loading…
Cancel
Save