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
ConstructorDescriptionMetricsRestTemplateCustomizer
(io.micrometer.core.instrument.MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, String metricName, AutoTimer autoTimer) Creates a newMetricsRestTemplateInterceptor
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
customize
(RestTemplate restTemplate) Callback to customize aRestTemplate
instance.
-
Constructor Details
-
MetricsRestTemplateCustomizer
public MetricsRestTemplateCustomizer(io.micrometer.core.instrument.MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, String metricName, AutoTimer autoTimer) Creates a newMetricsRestTemplateInterceptor
. WhenautoTimeRequests
is set totrue
, the interceptor records metrics using the givenmeterRegistry
with tags provided by the giventagProvider
and withauto-timed configuration
.- Parameters:
meterRegistry
- the meter registrytagProvider
- the tag providermetricName
- the name of the recorded metricautoTimer
- the auto-timers to apply ornull
to disable auto-timing- Since:
- 2.2.0
-
-
Method Details
-
customize
Description copied from interface:RestTemplateCustomizer
Callback to customize aRestTemplate
instance.- Specified by:
customize
in interfaceRestTemplateCustomizer
- Parameters:
restTemplate
- the template to customize
-