Class MetricCollectingRpcClient

All Implemented Interfaces:
Client<RpcRequest,​RpcResponse>, RpcClient, Unwrappable

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

Example:


 MyService.Iface client =
     Clients.builder(uri)
            .rpcDecorator(MetricCollectingRpcClient.newDecorator(MeterIdPrefixFunction.ofDefault("myClient")))
            .build(MyService.Iface.class);
 

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.