Monitor with the Google Cloud console

Stay organized with collections Save and categorize content based on your preferences.

This page explains how to monitor a Cloud Spanner instance by viewing current and historical data in the Google Cloud console.

View an instance's current status

When you open a Spanner instance in the Google Cloud console, you can see the current status of the most essential metrics for your instance, such as CPU utilization. You can also view the current metrics for a single database within the instance.

To view an instance's current status, follow these steps:

  1. In the Google Cloud console, open the list of Spanner instances.

    Go to the instance list

  2. Click the name of the instance you want to learn about.

    The Google Cloud console displays an overview of the instance, including the current values of several key metrics. Learn what metrics are available.

  3. Optional: To view the current metrics for a specific database in the instance, click the name of the database in the left pane.

    The Google Cloud console displays the current values of several key metrics.

View historical data for an instance

The Google Cloud console provides charts that show historical data for your instance. You can view charts for several different time periods, ranging from the past 1 hour to the past 30 days. You can also view charts for a single database within the instance.

To view historical data for an instance, follow these steps:

  1. In the Google Cloud console, open the list of Spanner instances.

    Go to the instance list

  2. Click the name of the instance you want to learn about, then click Monitoring on the left navigation.

    The Google Cloud console displays charts of historical data for the instance. Learn what charts are available.

  3. Optional: To view historical data for a different time period, find the buttons above the first chart, then click the time period you want to view.

  4. Optional: To control what data appears in the chart, click one of the drop-down lists in the chart. For example, if the instance uses a multi-region configuration, some charts provide a drop-down list to view data for a specific region. Not all charts have drop-down lists.

  5. Optional: To view historical data for a specific database in the instance, click the name of the database in the left pane.

Spanner charts and metrics

The Google Cloud console provides the following charts and metrics to show an instance's current and historical status. All charts and metrics are available at the instance level. You can also view many charts and metrics for a single database within an instance.

Available charts and metrics
Compute capacity

The compute capacity in the instance. You can choose to display the capacity in processing units or in nodes.

Available only for instances.

CPU utilization - rolling average 24 hour

A rolling average of total CPU utilization, as a percentage of the instance's CPU resources, for each database. Each data point is an average for the previous 24 hours.

Available only for instances.

CPU utilization - high priority

The total CPU utilization, as a percentage of the instance's CPU resources, for high-priority tasks. These tasks include most requests that you initiate, as well as maintenance tasks that Spanner must complete promptly. Learn more about high-priority tasks.

Available for instances and databases.

CPU utilization - total

The total CPU utilization, as a percentage of the instance's CPU resources.

Available for instances and databases:

  • For instances, you can view charts of total CPU utilization by database, or by task priority.
  • For databases, you can view charts of total CPU utilization by task priority.
Latency

The amount of time that Spanner took to handle a read or write request function. Use the drop down to select "Read", "Write", or select "Read /write" to view metrics for both. This measurement begins when the Spanner service receives a request, and it ends when the Spanner service starts to send a response. For more information, see Latency metrics.

You can view latency metrics for 50th and 99th percentile latency:

  • 50th percentile latency: The maximum latency, in seconds, for the fastest 50% of all requests
  • 99th percentile latency: The maximum latency, in seconds, for the fastest 99% of all requests

Available for instances and databases.

Latency by transaction type

The amount of time that Spanner took to process a transaction. You can select to view metrics for read-write and read-only type transactions. For more information, see Latency by transaction type.

The major difference between the Latency chart and the Latency by transaction type chart is that the Latency by transaction type chart allows you to select the leader involvement for the read-only type. You can select "Leader is involved" or "No leader is involved" for the read-only transaction. Reads which involve the leader might experience higher latency. You can use this chart to evaluate if you should use stale reads without communicating with the leader, assuming the timestamp bound is at least 15 seconds. For read-write transactions, the leader is always involved in the transaction so the data shown on the chart always include the time it took for the request to reach the leader and receive a response.

You can view latency metrics for 50th and 99th percentile latency:

  • 50th percentile latency: The maximum latency, in seconds, for the fastest 50% of all transactions.
  • 99th percentile latency: The maximum latency, in seconds, for the fastest 99% of all transactions.

Available for instances and databases.

Leader distribution

Available for multi-region instances and databases:

  • For instances, you can view the number of databases with the majority of leaders (>=50%) in a given region. Under the Regions dropdown menu, if you select a specific region, the chart shows the total number of databases within that instance that has the selected region as the leader region. If you select "All regions" under the Regions dropdown menu, the chart shows one line for each region, and each line shows the total number of databases in the instance that has that region as its leader region.
  • For databases, you can view the percentage of leaders grouped by region. For example, if a database has five leaders, one in us-west1 and four in us-east1 at a point-in-time, the "All regions" chart shows two lines (one per region). One line for us-west1 is at 20%, and the other line for us-east1 is at 80%. The us-west1 chart shows one single line at 20%, and the us-east1 chart shows one single line at 80%.

Note that if a database was recently created or a leader region was recently modified, the charts might not stabilize right away.

Operations per second

The number of operations that Spanner performed per second, or the number of errors that occurred on the Spanner server per second.

You can choose which operations to view in this chart:

  • Reads and writes
  • Reads only (also includes DML statements)
  • Writes only (excludes DML statements)
  • Errors on the Spanner server

Available for instances and databases.

Throughput (MB/sec)

The amount of uncompressed data that was read from, or written to, the instance or database each second. This value is measured in binary megabytes (MB), where 1 MB is 220 bytes. This unit of measurement is also known as a mebibyte (MiB).

Read throughput includes requests and responses for methods in the read API and for SQL queries. It also includes requests and responses for DML statements.

Write throughput includes requests and responses to commit data through the mutation API. It excludes requests and responses for DML statements.

Available for instances and databases.

Total database storage

The amount of data that is stored in the instance or database. This value is measured in binary byte units. For example, 1 binary gigabyte (GB) is 230 bytes; this unit of measurement is also known as a gibibyte (GiB).

Available for instances and databases.

Total backup storage

The amount of data that is stored in the backups that are associated with the instance or database. This value is measured in binary byte units. For example, 1 binary gigabyte (GB) is 230 bytes; this unit of measurement is also known as a gibibyte (GiB).

Available for instances and databases.

What's next