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:
In the Google Cloud console, open the list of Spanner instances.
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.
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:
In the Google Cloud console, open the list of Spanner instances.
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.
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.
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.
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:
|
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:
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:
Available for instances and databases. |
Leader distribution |
Available for multi-region instances and databases:
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:
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
- Understand the CPU utilization and latency metrics for Spanner.
- Set up customized charts and alerts with Cloud Monitoring.
- Get details about types of Spanner instances.