Cloud Spanner Logging

Introduction

This page summarizes the logs available in Stackdriver Logging from Cloud Spanner.

Logging is automatic for Cloud Spanner. Administration operations that perform the following are automatically logged to the Cloud Audit Logs:

  • Creating, updating, or deleting an instance
  • Creating, updating, or dropping a database

Logged instance administration operations

The following Cloud Spanner instance administration operations are logged in Stackdriver Logging. All fields are strings unless otherwise specified and are captured together in the request field in the log entry.

CreateInstance

Field name Contents
instance_id The name of the instance to delete, in the form projects/<project_id>/instances/<instance_id>
config The name of the instance's configuration, in the form projects/<project_id>/instanceConfigs/<configuration>
display name The descriptive name for this instance as it appears in the Google Cloud Platform Console
node_count The number of nodes allocated to this instance (int32)
state The state of the instance (enum State).
This can be one of the following values:
  • 0: UNSPECIFIED_STATE
  • 1: CREATING
  • 2: READY

UpdateInstance

Field name Contents
name The unique ID for the instance to update, in the form projects/<project_id>/instances/<instance_id>
config The name of the instance's configuration, in the form projects/<project_id>/instanceConfigs/<configuration>
display name The descriptive name for this instance as it appears in the Google Cloud Platform Console
node_count The number of nodes allocated to this instance (int32)
field_mask A field mask specifying which fields to update (google.protobuf.FieldMask)

DeleteInstance

Field name Contents
name The name of the instance to delete, in the form projects/<project_id>/instances/<instance_id>

Logged database administration operations

The following Cloud Spanner database administration operations are logged in Stackdriver Logging. All fields are strings and are captured together in the request field in the log entry.

CreateDatabase

Field name Contents
parent The ID of the instance where the database is being created, in the form projects/<project_id>/instances/<instance_id>
create_statement The statement used to create the database, in the form CREATE DATABASE '<database_id>'
extra_statements An optional list of Data Definition Language (DDL) statements, such as CREATE TABLE, that create the initial schema for the database

GetDatabase

Field name Contents
Name The unique ID for the database to retrieve, in the form projects/<project_id>/instances/<instance_id>/databases/<database_id>

UpdateDatabaseDdl

Field name Contents
database The unique ID for the database to update, in the form projects/<project_id>/instances/<instance_id>/databases/<database_id>
statements DDL statements, such as CREATE TABLE, that create or delete tables, columns, indexes, etc.
operation_id The ID of the operation that performs the database update

DropDatabase

Field name Contents
database The unique ID for the database to drop, in the form projects/<project_id>/instances/<instance_id>/databases/<database_id>

What's Next

Send feedback about...

Cloud Spanner Documentation