Interface MetricsRecorder


@BetaApi @InternalApi 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.
  • Method Details

    • recordAttemptLatency

      default void recordAttemptLatency(double attemptLatency, Map<String,String> attributes)
      Records the latency of an RPC attempt
    • recordAttemptCount

      default void recordAttemptCount(long count, Map<String,String> attributes)
      Records the count of RPC attempts
    • recordOperationLatency

      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.
    • recordOperationCount

      default void recordOperationCount(long count, Map<String,String> attributes)
      Records the count of operations