diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java index a50543b7131..04ea5c467e3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java @@ -20,7 +20,6 @@ import java.util.LinkedHashMap; import java.util.Map; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.boot.context.properties.NestedConfigurationProperty; /** @@ -110,28 +109,6 @@ public class MetricsProperties { return this.request; } - /** - * Return the name of the metric for client requests. - * @return request metric name - * @deprecated since 2.2.0 in favor of {@link ClientRequest#getMetricName()} - */ - @Deprecated - @DeprecatedConfigurationProperty(replacement = "management.metrics.web.client.request.metric-name") - public String getRequestsMetricName() { - return this.request.getMetricName(); - } - - /** - * Set the name of the metric for client requests. - * @param requestsMetricName request metric name - * @deprecated since 2.2.0 in favor of - * {@link ClientRequest#setMetricName(String)} - */ - @Deprecated - public void setRequestsMetricName(String requestsMetricName) { - this.request.setMetricName(requestsMetricName); - } - public int getMaxUriTags() { return this.maxUriTags; } @@ -184,50 +161,6 @@ public class MetricsProperties { return this.request; } - /** - * Return whether server requests should be automatically timed. - * @return {@code true} if server request should be automatically timed - * @deprecated since 2.2.0 in favor of {@link AutoTimeProperties#isEnabled()} - */ - @DeprecatedConfigurationProperty(replacement = "management.metrics.web.server.request.autotime.enabled") - @Deprecated - public boolean isAutoTimeRequests() { - return this.request.getAutotime().isEnabled(); - } - - /** - * Set whether server requests should be automatically timed. - * @param autoTimeRequests whether server requests should be automatically - * timed - * @deprecated since 2.2.0 in favor of {@link AutoTimeProperties#isEnabled()} - */ - @Deprecated - public void setAutoTimeRequests(boolean autoTimeRequests) { - this.request.getAutotime().setEnabled(autoTimeRequests); - } - - /** - * Return name of the metric for server requests. - * @return request metric name - * @deprecated since 2.2.0 in favor of {@link ServerRequest#getMetricName()} - */ - @DeprecatedConfigurationProperty(replacement = "management.metrics.web.server.request.metric-name") - @Deprecated - public String getRequestsMetricName() { - return this.request.getMetricName(); - } - - /** - * Set the name of the metric for server requests. - * @param requestsMetricName request metric name - * @deprecated since 2.2.0 in favor of - * {@link ServerRequest#setMetricName(String)} - */ - @Deprecated - public void setRequestsMetricName(String requestsMetricName) { - this.request.setMetricName(requestsMetricName); - } - public int getMaxUriTags() { return this.maxUriTags; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/reactive/WebFluxMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/reactive/WebFluxMetricsAutoConfigurationTests.java index 415deb65ac6..9a5b1a43920 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/reactive/WebFluxMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/reactive/WebFluxMetricsAutoConfigurationTests.java @@ -112,17 +112,6 @@ class WebFluxMetricsAutoConfigurationTests { }); } - @Test - @Deprecated - void metricsAreNotRecordedIfAutoTimeRequestsIsDisabledWithDeprecatedProperty() { - this.contextRunner.withConfiguration(AutoConfigurations.of(WebFluxAutoConfiguration.class)) - .withUserConfiguration(TestController.class) - .withPropertyValues("management.metrics.web.server.auto-time-requests=false").run((context) -> { - MeterRegistry registry = getInitializedMeterRegistry(context); - assertThat(registry.find("http.server.requests").meter()).isNull(); - }); - } - private MeterRegistry getInitializedMeterRegistry(AssertableReactiveWebApplicationContext context) { WebTestClient webTestClient = WebTestClient.bindToApplicationContext(context).build(); for (int i = 0; i < 3; i++) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsClientHttpRequestInterceptor.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsClientHttpRequestInterceptor.java index 1aeee033adf..e280b1e9d22 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsClientHttpRequestInterceptor.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsClientHttpRequestInterceptor.java @@ -53,20 +53,6 @@ class MetricsClientHttpRequestInterceptor implements ClientHttpRequestIntercepto private final AutoTimer autoTimer; - /** - * Create a new {@code MetricsClientHttpRequestInterceptor}. - * @param meterRegistry the registry to which metrics are recorded - * @param tagProvider provider for metrics tags - * @param metricName name of the metric to record - * @deprecated since 2.2.0 in favor of - * {@link #MetricsClientHttpRequestInterceptor(MeterRegistry, RestTemplateExchangeTagsProvider, String, AutoTimer)} - */ - @Deprecated - MetricsClientHttpRequestInterceptor(MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, - String metricName) { - this(meterRegistry, tagProvider, metricName, AutoTimer.ENABLED); - } - /** * Create a new {@code MetricsClientHttpRequestInterceptor}. * @param meterRegistry the registry to which metrics are recorded diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizer.java index 889d9b28d0b..1cacb641645 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizer.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,22 +39,6 @@ public class MetricsRestTemplateCustomizer implements RestTemplateCustomizer { private final MetricsClientHttpRequestInterceptor interceptor; - /** - * Creates a new {@code MetricsRestTemplateInterceptor} that will record metrics using - * the given {@code meterRegistry} with tags provided by the given - * {@code tagProvider}. - * @param meterRegistry the meter registry - * @param tagProvider the tag provider - * @param metricName the name of the recorded metric - * @deprecated since 2.2.0 in favor of - * {@link #MetricsRestTemplateCustomizer(MeterRegistry, RestTemplateExchangeTagsProvider, String, AutoTimer)} - */ - @Deprecated - public MetricsRestTemplateCustomizer(MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, - String metricName) { - this(meterRegistry, tagProvider, metricName, AutoTimer.ENABLED); - } - /** * Creates a new {@code MetricsRestTemplateInterceptor}. When {@code autoTimeRequests} * is set to {@code true}, the interceptor records metrics using the given diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientCustomizer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientCustomizer.java index 911c0c71bd1..5b4be59ba1a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientCustomizer.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,22 +33,6 @@ public class MetricsWebClientCustomizer implements WebClientCustomizer { private final MetricsWebClientFilterFunction filterFunction; - /** - * Create a new {@code MetricsWebClientFilterFunction} that will record metrics using - * the given {@code meterRegistry} with tags provided by the given - * {@code tagProvider}. - * @param meterRegistry the meter registry - * @param tagProvider the tag provider - * @param metricName the name of the recorded metric - * @deprecated since 2.2.0 in favor of - * {@link #MetricsWebClientCustomizer(MeterRegistry, WebClientExchangeTagsProvider, String, AutoTimer)} - */ - @Deprecated - public MetricsWebClientCustomizer(MeterRegistry meterRegistry, WebClientExchangeTagsProvider tagProvider, - String metricName) { - this(meterRegistry, tagProvider, metricName, AutoTimer.ENABLED); - } - /** * Create a new {@code MetricsWebClientFilterFunction} that will record metrics using * the given {@code meterRegistry} with tags provided by the given diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientFilterFunction.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientFilterFunction.java index 8cc9506cf4e..5ecb25f641e 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientFilterFunction.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientFilterFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,20 +50,6 @@ public class MetricsWebClientFilterFunction implements ExchangeFilterFunction { private final AutoTimer autoTimer; - /** - * Create a new {@code MetricsWebClientFilterFunction}. - * @param meterRegistry the registry to which metrics are recorded - * @param tagProvider provider for metrics tags - * @param metricName name of the metric to record - * @deprecated since 2.2.0 in favor of - * {@link #MetricsWebClientFilterFunction(MeterRegistry, WebClientExchangeTagsProvider, String, AutoTimer)} - */ - @Deprecated - public MetricsWebClientFilterFunction(MeterRegistry meterRegistry, WebClientExchangeTagsProvider tagProvider, - String metricName) { - this(meterRegistry, tagProvider, metricName, AutoTimer.ENABLED); - } - /** * Create a new {@code MetricsWebClientFilterFunction}. * @param meterRegistry the registry to which metrics are recorded diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java index faf21ebfb71..09760ba24a7 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,21 +49,6 @@ public class MetricsWebFilter implements WebFilter { private final AutoTimer autoTimer; - /** - * Create a new {@code MetricsWebFilter}. - * @param registry the registry to which metrics are recorded - * @param tagsProvider provider for metrics tags - * @param metricName name of the metric to record - * @param autoTimeRequests if requests should be automatically timed - * @deprecated since 2.2.0 in favor of - * {@link #MetricsWebFilter(MeterRegistry, WebFluxTagsProvider, String, AutoTimer)} - */ - @Deprecated - public MetricsWebFilter(MeterRegistry registry, WebFluxTagsProvider tagsProvider, String metricName, - boolean autoTimeRequests) { - this(registry, tagsProvider, metricName, AutoTimer.ENABLED); - } - /** * Create a new {@code MetricsWebFilter}. * @param registry the registry to which metrics are recorded diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java index 7cc029ffafc..035fe2d7d0d 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,22 +60,6 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter { private final AutoTimer autoTimer; - /** - * Create a new {@link WebMvcMetricsFilter} instance. - * @param registry the meter registry - * @param tagsProvider the tags provider - * @param metricName the metric name - * @param autoTimeRequests if requests should be automatically timed - * @since 2.0.7 - * @deprecated since 2.2.0 in favor of - * {@link #WebMvcMetricsFilter(MeterRegistry, WebMvcTagsProvider, String, AutoTimer)} - */ - @Deprecated - public WebMvcMetricsFilter(MeterRegistry registry, WebMvcTagsProvider tagsProvider, String metricName, - boolean autoTimeRequests) { - this(registry, tagsProvider, metricName, AutoTimer.ENABLED); - } - /** * Create a new {@link WebMvcMetricsFilter} instance. * @param registry the meter registry