Getting started with Key Visualizer

Overview

Key Visualizer is enabled by default.

There are some situations in which data may not be immediately available in Key Visualizer.

  • Storage and traffic statistics for newly created databases may not be available immediately.
  • Traffic statistics for newly inserted rows may be attributed to existing key ranges.

The Key Visualizer interface

The Key Visualizer tool is accessed from the Google Cloud Console.

To access Key Visualizer:

  1. From the Spanner page of the Cloud Console, select an instance.

  2. Select a database to investigate.

  3. In the left navigation menu, under Monitoring, select Key Visualizer.

Disable Key Visualizer

Key Visualizer enablement is controlled by the enable_key_visualizer database option. The default value is true.

To disable Key Visualizer, set the value of the enable_key_visualizer database option to false. The DDL syntax to disable Key Visualizer is:

ALTER DATABASE `database_id` SET OPTIONS (enable_key_visualizer=false)

If your database ID contains characters other than letters, numbers, or underscores, be sure to enclose the ID with backticks (``).

The statement can be sent using a gcloud command, or in an UpdateDatabaseDdl gRPC/REST request. For example:

gcloud spanner databases ddl update database_id --instance=instance_id \
    --ddl='ALTER DATABASE `database_id` SET OPTIONS ( enable_key_visualizer=false )'

Once you've explicitly set the value for enable_key_visualizer, you can check its value by clicking SHOW EQUIVALENT DDL in the overview page, or using the ddl describe gcloud command:

gcloud spanner databases ddl describe `database_id` --instance=instance_id

Re-enable Key Visualizer

To re-enable Key Visualizer, follow the instructions in Disable Key Visualizer, setting the value of the enable_key_visualizer database option to true.

When first re-enabled for a database, the Key Visualizer heatmap will be empty for the first few minutes while Cloud Spanner collects metrics.

What's next