Client-side metrics descriptions

This page provides a detailed description of each client-side metric that Spanner offers. For more information about viewing and managing client-side metrics, see View and manage client-side metrics.

Client-side metrics offer latency information about the client's RPC request attempts and operations to Spanner.

An attempt is a single RPC request from the client to Spanner. The client can make multiple attempts if a request fails.

An operation represents completion of all RPC requests, including all the attempts the client made to Spanner. An operation is completed when the client receives a response or exhausts all attempts.

These metrics include DISTRIBUTION and INT64 metric value types. For more information, see Value types and metric kinds.

Client-side metrics are available when you use the Spanner client library for Java or Go.

The client-side metrics support all Spanner methods available in the google.spanner.v1.Spanner RPC API.

Operation latencies

The operation latencies metric measures an operation's round trip from the client gRPC layer to Spanner and back to the client.

This metric has the following attributes:

  • Metric name : spanner.googleapis.com/client/operation_latencies
  • Metric value type: DISTRIBUTION
  • Available dimensions:
    • project ID: the Google Cloud project ID.
    • instance ID: the Spanner instance ID.
    • database ID: the Spanner database ID.
    • location: the Google Cloud region where the client-side metrics are published. If your application is deployed outside Google Cloud, then the metrics are published to the global region.
    • method: the RPC method name—for example, spanner.commit.
    • status: the RPC status—for example, OK or INTERNAL.
    • client_name: the library name and version—for example, spanner-java/6.70.1.

Operation count

The operation count metric records the number of operations performed.

This metric has the following attributes:

  • Metric name: spanner.googleapis.com/client/operation_count
  • Metric value type: INT64
  • Available dimensions:
    • project ID: the Google Cloud project ID.
    • instance ID: the Spanner instance ID.
    • database ID: the Spanner database ID.
    • location: the Google Cloud region where the client-side metrics are published. If your application is deployed outside Google Cloud, then the metrics are published to the global region.
    • method: the RPC method name—for example, spanner.commit.
    • status: the RPC status—for example, OK or INTERNAL.
    • client_name: the library name and version. For example, spanner-java/6.70.1.

Attempt latencies

The attempt latencies metric measures the duration it takes for a single RPC request to reach Spanner from the client. The attempt_latencies value is typically identical to the operation_latencies value. If the client receives transient errors, then the operation_latencies value is a sum of all the attempt_latencies values.

This metric has the following attributes:

  • Metric name: spanner.googleapis.com/client/attempt_latencies
  • Metric value type: DISTRIBUTION
  • Available dimensions:
    • project ID: the Google Cloud project ID.
    • instance ID: the Spanner instance ID.
    • database ID: the Spanner database ID.
    • location: the Google Cloud region where the client-side metrics are published. If your application is deployed outside Google Cloud, then the metrics are published to the global region.
    • method: the RPC method name—for example, spanner.commit.
    • status: the RPC status—for example, OK or INTERNAL.
    • client_name: the library name and version. For example, spanner-java/6.70.1.

Attempt count

The attempt count metric records the number of attempts performed. The attempt_count value is typically identical to the operation_count value. If the client receives transient errors, the attempt_count value is the sum of all attempts.

This metric has the following attributes:

  • Metric name: spanner.googleapis.com/client/attempt_count
  • Metric value type: INT64
  • Available dimensions:
    • project ID: the Google Cloud project ID.
    • instance ID: the Spanner instance ID.
    • database ID: the Spanner database ID.
    • location: the Google Cloud region where the client-side metrics are published. If your application is deployed outside Google Cloud, then the metrics are published to the global region.
    • method: the RPC method name—for example, spanner.commit.
    • status: the RPC status—for example, OK or INTERNAL.
    • client_name: the library name and version. For example, spanner-java/6.70.1.

What's next