Class MetricCollectingClient

All Implemented Interfaces:
Client<HttpRequest,​HttpResponse>, HttpClient, Unwrappable

public final class MetricCollectingClient
extends SimpleDecoratingClient<I,​O>
implements HttpClient
Decorates an HttpClient to collect metrics into MeterRegistry.

Example:


 WebClient client = WebClient
         .builder(uri)
         .decorator(MetricCollectingClient.newDecorator(MeterIdPrefixFunction.ofDefault("myClient")))
         .build();
 
 

It is generally recommended not to use a class or package name as a metric name, because otherwise seemingly harmless refactoring such as rename may break metric collection.