Interface MetricsRecorder (2.48.0)

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
Name Description
count long
attributes Map<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
Name Description
attemptLatency double
attributes Map<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
Name Description
count long
attributes Map<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
Name Description
operationLatency double
attributes Map<String,String>