Package com.google.api.gax.tracing
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 Summary
Modifier and TypeMethodDescriptiondefault voidrecordAttemptCount(long count, Map<String, String> attributes) Records the count of RPC attemptsdefault voidrecordAttemptLatency(double attemptLatency, Map<String, String> attributes) Records the latency of an RPC attemptdefault voidrecordOperationCount(long count, Map<String, String> attributes) Records the count of operationsdefault voidrecordOperationLatency(double operationLatency, Map<String, String> attributes) Records the total end-to-end latency for an operation, including the initial RPC attempts and subsequent retries.
-
Method Details
-
recordAttemptLatency
Records the latency of an RPC attempt -
recordAttemptCount
Records the count of RPC attempts -
recordOperationLatency
Records the total end-to-end latency for an operation, including the initial RPC attempts and subsequent retries. -
recordOperationCount
Records the count of operations
-