Class MetricsRestTemplateCustomizer

java.lang.Object
org.springframework.boot.actuate.metrics.web.client.MetricsRestTemplateCustomizer
All Implemented Interfaces:
RestTemplateCustomizer

public class MetricsRestTemplateCustomizer extends Object implements RestTemplateCustomizer
RestTemplateCustomizer that configures the RestTemplate to record request metrics.
Since:
2.0.0
Author:
Andy Wilkinson, Phillip Webb
  • Constructor Details

    • MetricsRestTemplateCustomizer

      public MetricsRestTemplateCustomizer(io.micrometer.core.instrument.MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider, String metricName, AutoTimer autoTimer)
      Creates a new 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.
      Parameters:
      meterRegistry - the meter registry
      tagProvider - the tag provider
      metricName - the name of the recorded metric
      autoTimer - the auto-timers to apply or null to disable auto-timing
      Since:
      2.2.0
  • Method Details