Polish "Limit metrics collection of incoming requests"
Closes gh-14173
This commit is contained in:
parent
81a6701914
commit
0625443d27
|
|
@ -30,6 +30,7 @@ import org.springframework.util.Assert;
|
|||
/**
|
||||
* {@link MeterFilter} to log only once a warning message and deny {@link Meter.Id}.
|
||||
*
|
||||
* @author Jon Schneider
|
||||
* @author Dmytro Nosan
|
||||
* @since 2.0.5
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -52,6 +52,12 @@ import org.springframework.web.client.RestTemplate;
|
|||
@ConditionalOnBean(MeterRegistry.class)
|
||||
public class RestTemplateMetricsAutoConfiguration {
|
||||
|
||||
private final MetricsProperties properties;
|
||||
|
||||
public RestTemplateMetricsAutoConfiguration(MetricsProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(RestTemplateExchangeTagsProvider.class)
|
||||
public DefaultRestTemplateExchangeTagsProvider restTemplateTagConfigurer() {
|
||||
|
|
@ -61,22 +67,20 @@ public class RestTemplateMetricsAutoConfiguration {
|
|||
@Bean
|
||||
public MetricsRestTemplateCustomizer metricsRestTemplateCustomizer(
|
||||
MeterRegistry meterRegistry,
|
||||
RestTemplateExchangeTagsProvider restTemplateTagConfigurer,
|
||||
MetricsProperties properties) {
|
||||
RestTemplateExchangeTagsProvider restTemplateTagConfigurer) {
|
||||
return new MetricsRestTemplateCustomizer(meterRegistry, restTemplateTagConfigurer,
|
||||
properties.getWeb().getClient().getRequestsMetricName());
|
||||
this.properties.getWeb().getClient().getRequestsMetricName());
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Order(0)
|
||||
public MeterFilter metricsWebClientUriTagFilter(MetricsProperties properties) {
|
||||
String metricName = properties.getWeb().getClient().getRequestsMetricName();
|
||||
MeterFilter denyFilter = new OnlyOnceLoggingDenyMeterFilter(() -> String.format(
|
||||
"Reached the maximum number of URI tags for '%s'. "
|
||||
+ "Are you using uriVariables on RestTemplate calls?",
|
||||
metricName));
|
||||
public MeterFilter metricsWebClientUriTagFilter() {
|
||||
String metricName = this.properties.getWeb().getClient().getRequestsMetricName();
|
||||
MeterFilter denyFilter = new OnlyOnceLoggingDenyMeterFilter(() -> String
|
||||
.format("Reached the maximum number of URI tags for '%s'. Are you using "
|
||||
+ "'uriVariables' on RestTemplate calls?", metricName));
|
||||
return MeterFilter.maximumAllowableTags(metricName, "uri",
|
||||
properties.getWeb().getClient().getMaxUriTags(), denyFilter);
|
||||
this.properties.getWeb().getClient().getMaxUriTags(), denyFilter);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,12 @@ import org.springframework.core.annotation.Order;
|
|||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
|
||||
public class WebFluxMetricsAutoConfiguration {
|
||||
|
||||
private final MetricsProperties properties;
|
||||
|
||||
public WebFluxMetricsAutoConfiguration(MetricsProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(WebFluxTagsProvider.class)
|
||||
public DefaultWebFluxTagsProvider webfluxTagConfigurer() {
|
||||
|
|
@ -58,19 +64,19 @@ public class WebFluxMetricsAutoConfiguration {
|
|||
|
||||
@Bean
|
||||
public MetricsWebFilter webfluxMetrics(MeterRegistry registry,
|
||||
WebFluxTagsProvider tagConfigurer, MetricsProperties properties) {
|
||||
WebFluxTagsProvider tagConfigurer) {
|
||||
return new MetricsWebFilter(registry, tagConfigurer,
|
||||
properties.getWeb().getServer().getRequestsMetricName());
|
||||
this.properties.getWeb().getServer().getRequestsMetricName());
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Order(0)
|
||||
public MeterFilter metricsHttpServerUriTagFilter(MetricsProperties properties) {
|
||||
String metricName = properties.getWeb().getServer().getRequestsMetricName();
|
||||
public MeterFilter metricsHttpServerUriTagFilter() {
|
||||
String metricName = this.properties.getWeb().getServer().getRequestsMetricName();
|
||||
MeterFilter filter = new OnlyOnceLoggingDenyMeterFilter(() -> String
|
||||
.format("Reached the maximum number of URI tags for '%s'.", metricName));
|
||||
return MeterFilter.maximumAllowableTags(metricName, "uri",
|
||||
properties.getWeb().getServer().getMaxUriTags(), filter);
|
||||
this.properties.getWeb().getServer().getMaxUriTags(), filter);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,12 @@ import org.springframework.web.servlet.DispatcherServlet;
|
|||
@EnableConfigurationProperties(MetricsProperties.class)
|
||||
public class WebMvcMetricsAutoConfiguration {
|
||||
|
||||
private final MetricsProperties properties;
|
||||
|
||||
public WebMvcMetricsAutoConfiguration(MetricsProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(WebMvcTagsProvider.class)
|
||||
public DefaultWebMvcTagsProvider webMvcTagsProvider() {
|
||||
|
|
@ -69,9 +75,9 @@ public class WebMvcMetricsAutoConfiguration {
|
|||
|
||||
@Bean
|
||||
public FilterRegistrationBean<WebMvcMetricsFilter> webMvcMetricsFilter(
|
||||
MeterRegistry registry, MetricsProperties properties,
|
||||
WebMvcTagsProvider tagsProvider, WebApplicationContext context) {
|
||||
Server serverProperties = properties.getWeb().getServer();
|
||||
MeterRegistry registry, WebMvcTagsProvider tagsProvider,
|
||||
WebApplicationContext context) {
|
||||
Server serverProperties = this.properties.getWeb().getServer();
|
||||
WebMvcMetricsFilter filter = new WebMvcMetricsFilter(context, registry,
|
||||
tagsProvider, serverProperties.getRequestsMetricName(),
|
||||
serverProperties.isAutoTimeRequests());
|
||||
|
|
@ -84,12 +90,12 @@ public class WebMvcMetricsAutoConfiguration {
|
|||
|
||||
@Bean
|
||||
@Order(0)
|
||||
public MeterFilter metricsHttpServerUriTagFilter(MetricsProperties properties) {
|
||||
String metricName = properties.getWeb().getServer().getRequestsMetricName();
|
||||
public MeterFilter metricsHttpServerUriTagFilter() {
|
||||
String metricName = this.properties.getWeb().getServer().getRequestsMetricName();
|
||||
MeterFilter filter = new OnlyOnceLoggingDenyMeterFilter(() -> String
|
||||
.format("Reached the maximum number of URI tags for '%s'.", metricName));
|
||||
return MeterFilter.maximumAllowableTags(metricName, "uri",
|
||||
properties.getWeb().getServer().getMaxUriTags(), filter);
|
||||
this.properties.getWeb().getServer().getMaxUriTags(), filter);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright 2012-2018 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.autoconfigure.metrics.web;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* Test controller used by metrics tests.
|
||||
*
|
||||
* @author Dmytro Nosan
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@RestController
|
||||
public class TestController {
|
||||
|
||||
@GetMapping("test0")
|
||||
public String test0() {
|
||||
return "test0";
|
||||
}
|
||||
|
||||
@GetMapping("test1")
|
||||
public String test1() {
|
||||
return "test1";
|
||||
}
|
||||
|
||||
@GetMapping("test2")
|
||||
public String test2() {
|
||||
return "test2";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -20,11 +20,11 @@ import io.micrometer.core.instrument.MeterRegistry;
|
|||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties;
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun;
|
||||
import org.springframework.boot.actuate.metrics.web.client.MetricsRestTemplateCustomizer;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
|
||||
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||
|
|
@ -76,31 +76,45 @@ public class RestTemplateMetricsAutoConfigurationTests {
|
|||
@Test
|
||||
public void afterMaxUrisReachedFurtherUrisAreDenied() {
|
||||
this.contextRunner
|
||||
.withPropertyValues("management.metrics.web.client.max-uri-tags=10")
|
||||
.withPropertyValues("management.metrics.web.client.max-uri-tags=2")
|
||||
.run((context) -> {
|
||||
MetricsProperties properties = context
|
||||
.getBean(MetricsProperties.class);
|
||||
int maxUriTags = properties.getWeb().getClient().getMaxUriTags();
|
||||
MeterRegistry registry = context.getBean(MeterRegistry.class);
|
||||
RestTemplate restTemplate = context.getBean(RestTemplateBuilder.class)
|
||||
.build();
|
||||
MockRestServiceServer server = MockRestServiceServer
|
||||
.createServer(restTemplate);
|
||||
for (int i = 0; i < maxUriTags + 10; i++) {
|
||||
server.expect(requestTo("/test/" + i))
|
||||
.andRespond(withStatus(HttpStatus.OK));
|
||||
}
|
||||
for (int i = 0; i < maxUriTags + 10; i++) {
|
||||
restTemplate.getForObject("/test/" + i, String.class);
|
||||
}
|
||||
assertThat(registry.get("http.client.requests").meters())
|
||||
.hasSize(maxUriTags);
|
||||
assertThat(this.out.toString())
|
||||
.contains("Reached the maximum number of URI tags "
|
||||
+ "for 'http.client.requests'. Are you using uriVariables on RestTemplate calls?");
|
||||
MeterRegistry registry = getInitializedMeterRegistry(context);
|
||||
assertThat(registry.get("http.client.requests").meters()).hasSize(2);
|
||||
assertThat(this.out.toString()).contains(
|
||||
"Reached the maximum number of URI tags for 'http.client.requests'.");
|
||||
assertThat(this.out.toString()).contains(
|
||||
"Are you using 'uriVariables' on RestTemplate calls?");
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotDenyNorLogIfMaxUrisIsNotReached() {
|
||||
this.contextRunner
|
||||
.withPropertyValues("management.metrics.web.client.max-uri-tags=5")
|
||||
.run((context) -> {
|
||||
MeterRegistry registry = getInitializedMeterRegistry(context);
|
||||
assertThat(registry.get("http.client.requests").meters()).hasSize(3);
|
||||
assertThat(this.out.toString()).doesNotContain(
|
||||
"Reached the maximum number of URI tags for 'http.client.requests'.");
|
||||
assertThat(this.out.toString()).doesNotContain(
|
||||
"Are you using 'uriVariables' on RestTemplate calls?");
|
||||
});
|
||||
}
|
||||
|
||||
private MeterRegistry getInitializedMeterRegistry(
|
||||
AssertableApplicationContext context) {
|
||||
MeterRegistry registry = context.getBean(MeterRegistry.class);
|
||||
RestTemplate restTemplate = context.getBean(RestTemplateBuilder.class).build();
|
||||
MockRestServiceServer server = MockRestServiceServer.createServer(restTemplate);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
server.expect(requestTo("/test/" + i)).andRespond(withStatus(HttpStatus.OK));
|
||||
}
|
||||
for (int i = 0; i < 3; i++) {
|
||||
restTemplate.getForObject("/test/" + i, String.class);
|
||||
}
|
||||
return registry;
|
||||
}
|
||||
|
||||
private void validateRestTemplate(RestTemplate restTemplate, MeterRegistry registry) {
|
||||
MockRestServiceServer server = MockRestServiceServer.createServer(restTemplate);
|
||||
server.expect(requestTo("/test")).andRespond(withStatus(HttpStatus.OK));
|
||||
|
|
|
|||
|
|
@ -19,22 +19,21 @@ package org.springframework.boot.actuate.autoconfigure.metrics.web.reactive;
|
|||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.web.TestController;
|
||||
import org.springframework.boot.actuate.metrics.web.reactive.server.DefaultWebFluxTagsProvider;
|
||||
import org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter;
|
||||
import org.springframework.boot.actuate.metrics.web.reactive.server.WebFluxTagsProvider;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration;
|
||||
import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext;
|
||||
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
|
@ -77,14 +76,7 @@ public class WebFluxMetricsAutoConfigurationTests {
|
|||
.withUserConfiguration(TestController.class)
|
||||
.withPropertyValues("management.metrics.web.server.max-uri-tags=2")
|
||||
.run((context) -> {
|
||||
WebTestClient webTestClient = WebTestClient
|
||||
.bindToApplicationContext(context).build();
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
webTestClient.get().uri("/test" + i).exchange().expectStatus()
|
||||
.isOk();
|
||||
}
|
||||
MeterRegistry registry = context.getBean(MeterRegistry.class);
|
||||
MeterRegistry registry = getInitializedMeterRegistry(context);
|
||||
assertThat(registry.get("http.server.requests").meters()).hasSize(2);
|
||||
assertThat(this.output.toString())
|
||||
.contains("Reached the maximum number of URI tags "
|
||||
|
|
@ -92,6 +84,30 @@ public class WebFluxMetricsAutoConfigurationTests {
|
|||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotDenyNorLogIfMaxUrisIsNotReached() {
|
||||
this.contextRunner
|
||||
.withConfiguration(AutoConfigurations.of(WebFluxAutoConfiguration.class))
|
||||
.withUserConfiguration(TestController.class)
|
||||
.withPropertyValues("management.metrics.web.server.max-uri-tags=5")
|
||||
.run((context) -> {
|
||||
MeterRegistry registry = getInitializedMeterRegistry(context);
|
||||
assertThat(registry.get("http.server.requests").meters()).hasSize(3);
|
||||
assertThat(this.output.toString()).doesNotContain(
|
||||
"Reached the maximum number of URI tags for 'http.server.requests'");
|
||||
});
|
||||
}
|
||||
|
||||
private MeterRegistry getInitializedMeterRegistry(
|
||||
AssertableReactiveWebApplicationContext context) {
|
||||
WebTestClient webTestClient = WebTestClient.bindToApplicationContext(context)
|
||||
.build();
|
||||
for (int i = 0; i < 3; i++) {
|
||||
webTestClient.get().uri("/test" + i).exchange().expectStatus().isOk();
|
||||
}
|
||||
return context.getBean(MeterRegistry.class);
|
||||
}
|
||||
|
||||
@Configuration
|
||||
protected static class CustomWebFluxTagsProviderConfig {
|
||||
|
||||
|
|
@ -102,24 +118,4 @@ public class WebFluxMetricsAutoConfigurationTests {
|
|||
|
||||
}
|
||||
|
||||
@RestController
|
||||
static class TestController {
|
||||
|
||||
@GetMapping("test0")
|
||||
public Mono<String> test0() {
|
||||
return Mono.just("test0");
|
||||
}
|
||||
|
||||
@GetMapping("test1")
|
||||
public Mono<String> test1() {
|
||||
return Mono.just("test1");
|
||||
}
|
||||
|
||||
@GetMapping("test2")
|
||||
public Mono<String> test2() {
|
||||
return Mono.just("test2");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.autoconfigure.web.servlet;
|
||||
package org.springframework.boot.actuate.autoconfigure.metrics.web.servlet;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
|
|
@ -31,12 +31,13 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.web.servlet.WebMvcMetricsAutoConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.web.TestController;
|
||||
import org.springframework.boot.actuate.metrics.web.servlet.DefaultWebMvcTagsProvider;
|
||||
import org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter;
|
||||
import org.springframework.boot.actuate.metrics.web.servlet.WebMvcTagsProvider;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
|
||||
import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext;
|
||||
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
|
|
@ -46,8 +47,6 @@ import org.springframework.core.Ordered;
|
|||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
|
@ -116,21 +115,7 @@ public class WebMvcMetricsAutoConfigurationTests {
|
|||
WebMvcAutoConfiguration.class))
|
||||
.withPropertyValues("management.metrics.web.server.max-uri-tags=2")
|
||||
.run((context) -> {
|
||||
|
||||
assertThat(context).hasSingleBean(FilterRegistrationBean.class);
|
||||
Filter filter = context.getBean(FilterRegistrationBean.class)
|
||||
.getFilter();
|
||||
assertThat(filter).isInstanceOf(WebMvcMetricsFilter.class);
|
||||
|
||||
MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(context)
|
||||
.addFilters(filter).build();
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/test" + i))
|
||||
.andExpect(status().isOk());
|
||||
}
|
||||
|
||||
MeterRegistry registry = context.getBean(MeterRegistry.class);
|
||||
MeterRegistry registry = getInitializedMeterRegistry(context);
|
||||
assertThat(registry.get("http.server.requests").meters()).hasSize(2);
|
||||
assertThat(this.output.toString())
|
||||
.contains("Reached the maximum number of URI tags "
|
||||
|
|
@ -138,6 +123,37 @@ public class WebMvcMetricsAutoConfigurationTests {
|
|||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotDenyNorLogIfMaxUrisIsNotReached() {
|
||||
this.contextRunner
|
||||
.withUserConfiguration(TestController.class,
|
||||
MeterRegistryConfiguration.class)
|
||||
.withConfiguration(AutoConfigurations.of(MetricsAutoConfiguration.class,
|
||||
WebMvcAutoConfiguration.class))
|
||||
.withPropertyValues("management.metrics.web.server.max-uri-tags=5")
|
||||
.run((context) -> {
|
||||
MeterRegistry registry = getInitializedMeterRegistry(context);
|
||||
assertThat(registry.get("http.server.requests").meters()).hasSize(3);
|
||||
assertThat(this.output.toString())
|
||||
.doesNotContain("Reached the maximum number of URI tags "
|
||||
+ "for 'http.server.requests'");
|
||||
});
|
||||
}
|
||||
|
||||
private MeterRegistry getInitializedMeterRegistry(
|
||||
AssertableWebApplicationContext context) throws Exception {
|
||||
assertThat(context).hasSingleBean(FilterRegistrationBean.class);
|
||||
Filter filter = context.getBean(FilterRegistrationBean.class).getFilter();
|
||||
assertThat(filter).isInstanceOf(WebMvcMetricsFilter.class);
|
||||
MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(context).addFilters(filter)
|
||||
.build();
|
||||
for (int i = 0; i < 3; i++) {
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/test" + i))
|
||||
.andExpect(status().isOk());
|
||||
}
|
||||
return context.getBean(MeterRegistry.class);
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class MeterRegistryConfiguration {
|
||||
|
||||
|
|
@ -174,24 +190,4 @@ public class WebMvcMetricsAutoConfigurationTests {
|
|||
|
||||
}
|
||||
|
||||
@RestController
|
||||
static class TestController {
|
||||
|
||||
@GetMapping("test0")
|
||||
public String test0() {
|
||||
return "test0";
|
||||
}
|
||||
|
||||
@GetMapping("test1")
|
||||
public String test1() {
|
||||
return "test1";
|
||||
}
|
||||
|
||||
@GetMapping("test2")
|
||||
public String test2() {
|
||||
return "test2";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue