Class MetricsRestTemplateCustomizer
java.lang.Object
org.springframework.boot.actuate.metrics.web.client.MetricsRestTemplateCustomizer
- All Implemented Interfaces:
RestTemplateCustomizer
RestTemplateCustomizer that configures the RestTemplate to record
request metrics.- Since:
- 2.0.0
- Author:
- Andy Wilkinson, Phillip Webb
-
Constructor Summary
ConstructorsConstructorDescriptionMetricsRestTemplateCustomizer(io.micrometer.core.instrument.MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, String metricName, AutoTimer autoTimer) Creates a newMetricsRestTemplateInterceptor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcustomize(RestTemplate restTemplate) Callback to customize aRestTemplateinstance.
-
Constructor Details
-
MetricsRestTemplateCustomizer
public MetricsRestTemplateCustomizer(io.micrometer.core.instrument.MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, String metricName, AutoTimer autoTimer) Creates a newMetricsRestTemplateInterceptor. WhenautoTimeRequestsis set totrue, the interceptor records metrics using the givenmeterRegistrywith tags provided by the giventagProviderand withauto-timed configuration.- Parameters:
meterRegistry- the meter registrytagProvider- the tag providermetricName- the name of the recorded metricautoTimer- the auto-timers to apply ornullto disable auto-timing- Since:
- 2.2.0
-
-
Method Details
-
customize
Description copied from interface:RestTemplateCustomizerCallback to customize aRestTemplateinstance.- Specified by:
customizein interfaceRestTemplateCustomizer- Parameters:
restTemplate- the template to customize
-