Interface MetricsRecorder (2.46.1)

public interface MetricsRecorder

Provides an interface for metrics recording. The implementer is expected to use an observability framework, e.g. OpenTelemetry. There should be only one instance of MetricsRecorder per client, all the methods in this class are expected to be called from multiple threads, hence the implementation must be thread safe.

Methods

recordAttemptCount(long count, Map<String,String> attributes)

public default void recordAttemptCount(long count, Map<String,String> attributes)

Records the count of RPC attempts

Parameters
NameDescription
countlong
attributesMap<String,String>

recordAttemptLatency(double attemptLatency, Map<String,String> attributes)

public default void recordAttemptLatency(double attemptLatency, Map<String,String> attributes)

Records the latency of an RPC attempt

Parameters
NameDescription
attemptLatencydouble
attributesMap<String,String>

recordOperationCount(long count, Map<String,String> attributes)

public default void recordOperationCount(long count, Map<String,String> attributes)

Records the count of operations

Parameters
NameDescription
countlong
attributesMap<String,String>

recordOperationLatency(double operationLatency, Map<String,String> attributes)

public default void recordOperationLatency(double operationLatency, Map<String,String> attributes)

Records the total end-to-end latency for an operation, including the initial RPC attempts and subsequent retries.

Parameters
NameDescription
operationLatencydouble
attributesMap<String,String>