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)
Deprecated.
|
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(org.springframework.web.client.RestTemplate restTemplate)
Callback to customize a
RestTemplate instance. |
@Deprecated public MetricsRestTemplateCustomizer(io.micrometer.core.instrument.MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, String metricName)
MetricsRestTemplateCustomizer(MeterRegistry, RestTemplateExchangeTagsProvider, String, AutoTimer)
MetricsRestTemplateInterceptor
that will record metrics using
the given meterRegistry
with tags provided by the given
tagProvider
.meterRegistry
- the meter registrytagProvider
- the tag providermetricName
- the name of the recorded metricpublic 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(org.springframework.web.client.RestTemplate restTemplate)
RestTemplateCustomizer
RestTemplate
instance.customize
in interface RestTemplateCustomizer
restTemplate
- the template to customizeCopyright © 2019 Pivotal Software, Inc.. All rights reserved.