Class MetricsRestTemplateCustomizer

  • All Implemented Interfaces:
    org.springframework.boot.web.client.RestTemplateCustomizer

    public class MetricsRestTemplateCustomizer
    extends Object
    implements org.springframework.boot.web.client.RestTemplateCustomizer
    RestTemplateCustomizer that configures the RestTemplate to record request metrics.
    Since:
    2.0.0
    • Constructor Detail

      • MetricsRestTemplateCustomizer

        public MetricsRestTemplateCustomizer​(io.micrometer.core.instrument.MeterRegistry meterRegistry,
                                             RestTemplateExchangeTagsProvider tagProvider,
                                             String metricName)
        Creates a new MetricsRestTemplateInterceptor that will record metrics using the given meterRegistry with tags provided by the given tagProvider.
        Parameters:
        meterRegistry - the meter registry
        tagProvider - the tag provider
        metricName - the name of the recorded metric
    • Method Detail

      • customize

        public void customize​(org.springframework.web.client.RestTemplate restTemplate)
        Specified by:
        customize in interface org.springframework.boot.web.client.RestTemplateCustomizer