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,
boolean recordPercentiles)
Creates a new
MetricsRestTemplateInterceptor that will record metrics using
the given meterRegistry with tags provided by the given
tagProvider . |
Modifier and Type | Method and Description |
---|---|
void |
customize(org.springframework.web.client.RestTemplate restTemplate)
Callback to customize a
RestTemplate instance. |
public MetricsRestTemplateCustomizer(io.micrometer.core.instrument.MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, String metricName, boolean recordPercentiles)
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 metricrecordPercentiles
- whether percentile histogram buckets should be recordedpublic void customize(org.springframework.web.client.RestTemplate restTemplate)
RestTemplateCustomizer
RestTemplate
instance.customize
in interface RestTemplateCustomizer
restTemplate
- the template to customizeCopyright © 2017 Pivotal Software, Inc.. All rights reserved.