Class MetricsRestTemplateCustomizer

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

    public class MetricsRestTemplateCustomizer
    extends java.lang.Object
    implements org.springframework.boot.web.client.RestTemplateCustomizer
    RestTemplateCustomizer that configures the RestTemplate to record request metrics.
    • Constructor Summary

      Constructors 
      Constructor Description
      MetricsRestTemplateCustomizer​(io.micrometer.core.instrument.MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, java.lang.String metricName)
      Creates a new MetricsRestTemplateInterceptor that will record metrics using the given meterRegistry with tags provided by the given tagProvider.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void customize​(org.springframework.web.client.AsyncRestTemplate restTemplate)  
      void customize​(org.springframework.web.client.RestTemplate restTemplate)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MetricsRestTemplateCustomizer

        public MetricsRestTemplateCustomizer​(io.micrometer.core.instrument.MeterRegistry meterRegistry,
                                             RestTemplateExchangeTagsProvider tagProvider,
                                             java.lang.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
      • customize

        public void customize​(org.springframework.web.client.AsyncRestTemplate restTemplate)