public class MetricsRestTemplateCustomizer extends Object implements RestTemplateCustomizer
RestTemplateCustomizer
that configures the RestTemplate
to record
request metrics.Constructor and Description |
---|
MetricsRestTemplateCustomizer(io.micrometer.core.instrument.MeterRegistry meterRegistry,
RestTemplateExchangeTagsProvider tagProvider,
String metricName,
AutoTimer autoTimer)
Creates a new
MetricsRestTemplateInterceptor . |
Modifier and Type | Method and Description |
---|---|
void |
customize(RestTemplate restTemplate)
Callback to customize a
RestTemplate instance. |
public MetricsRestTemplateCustomizer(io.micrometer.core.instrument.MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, String metricName, AutoTimer autoTimer)
MetricsRestTemplateInterceptor
. When autoTimeRequests
is set to true
, the interceptor records metrics using the given
meterRegistry
with tags provided by the given tagProvider
and with
auto-timed configuration
.meterRegistry
- the meter registrytagProvider
- the tag providermetricName
- the name of the recorded metricautoTimer
- the auto-timers to apply or null
to disable auto-timingpublic void customize(RestTemplate restTemplate)
RestTemplateCustomizer
RestTemplate
instance.customize
in interface RestTemplateCustomizer
restTemplate
- the template to customize