parent
7f7ecdc7ac
commit
5b092f5d80
|
@ -149,6 +149,7 @@ public class MetricsProperties {
|
|||
*/
|
||||
private String metricName = "http.client.requests";
|
||||
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(replacement = "management.observations.http.client.requests.name")
|
||||
public String getMetricName() {
|
||||
return this.metricName;
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegi
|
|||
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties;
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
|
||||
import org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.observation.ObservationProperties;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
|
@ -61,11 +62,15 @@ public class HttpClientObservationsAutoConfiguration {
|
|||
|
||||
@Bean
|
||||
@Order(0)
|
||||
MeterFilter metricsHttpClientUriTagFilter(MetricsProperties properties) {
|
||||
String metricName = properties.getWeb().getClient().getRequest().getMetricName();
|
||||
MeterFilter denyFilter = new OnlyOnceLoggingDenyMeterFilter(() -> String.format(
|
||||
"Reached the maximum number of URI tags for '%s'. Are you using 'uriVariables'?", metricName));
|
||||
return MeterFilter.maximumAllowableTags(metricName, "uri", properties.getWeb().getClient().getMaxUriTags(),
|
||||
@SuppressWarnings("deprecation")
|
||||
MeterFilter metricsHttpClientUriTagFilter(ObservationProperties observationProperties,
|
||||
MetricsProperties metricsProperties) {
|
||||
String metricName = metricsProperties.getWeb().getClient().getRequest().getMetricName();
|
||||
String observationName = observationProperties.getHttp().getClient().getRequests().getName();
|
||||
String name = (observationName != null) ? observationName : metricName;
|
||||
MeterFilter denyFilter = new OnlyOnceLoggingDenyMeterFilter(() -> String
|
||||
.format("Reached the maximum number of URI tags for '%s'. Are you using 'uriVariables'?", name));
|
||||
return MeterFilter.maximumAllowableTags(name, "uri", metricsProperties.getWeb().getClient().getMaxUriTags(),
|
||||
denyFilter);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings({ "deprecation", "removal" })
|
||||
class ClientObservationConventionAdapterTests {
|
||||
|
||||
private static final String TEST_METRIC_NAME = "test.metric.name";
|
||||
|
|
|
@ -55,7 +55,7 @@ import static org.mockito.Mockito.mock;
|
|||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ExtendWith(OutputCaptureExtension.class)
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings({ "deprecation", "removal" })
|
||||
class WebClientObservationConfigurationTests {
|
||||
|
||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple())
|
||||
|
|
|
@ -32,7 +32,8 @@ import org.springframework.web.reactive.function.client.ClientResponse;
|
|||
* @deprecated since 3.0.0 for removal in 3.2.0 in favor of
|
||||
* {@link org.springframework.web.reactive.function.client.DefaultClientObservationConvention}
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(since = "3.0.0", forRemoval = true)
|
||||
@SuppressWarnings({ "deprecation", "removal" })
|
||||
public class DefaultWebClientExchangeTagsProvider implements WebClientExchangeTagsProvider {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock;
|
|||
* @author Brian Clozel
|
||||
* @author Nishant Raut
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings({ "deprecation", "removal" })
|
||||
class DefaultWebClientExchangeTagsProviderTests {
|
||||
|
||||
private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate";
|
||||
|
|
|
@ -40,7 +40,7 @@ import static org.mockito.Mockito.mock;
|
|||
* @author Brian Clozel
|
||||
* @author Nishant Raut
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "removal"})
|
||||
@SuppressWarnings({ "deprecation", "removal" })
|
||||
class WebClientExchangeTagsTests {
|
||||
|
||||
private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate";
|
||||
|
|
Loading…
Reference in New Issue