GCP Cloud SQL metrics

This page lists the Cloud SQL metrics collected by the GCP app.

In the table, the metric type prefixes are omitted. For example, the full name of the auto_failover_request_count metric, of type database, is cloudsql.googleapis.com/database/auto_failover_request_count.

All database types

Metric type prefix: cloudsql.googleapis.com/database/

Metric

Description

auto_failover_request_count

Delta of number of instances auto-failover requests.

available_for_failover

This is > 0 if the failover operation is available on the instance.

cpu/reserved_cores

Number of cores reserved for the database.

cpu/usage_time

Cumulative CPU usage time in seconds.

cpu/utilization

Current CPU utilization represented as a percentage of the reserved CPU that is currently in use. Values are typically numbers between 0.0 and 1.0 (but might exceed 1.0). Charts display the values as a percentage between 0% and 100% (or more).

disk/bytes_used

Data utilization in bytes.

disk/bytes_used_by_data_type

Data utilization in bytes.

disk/quota

Maximum data disk size in bytes.

disk/read_ops_count

Delta count of data disk read IO operations.

disk/utilization

The fraction of the disk quota that is currently in use.

disk/write_ops_count

Delta count of data disk write IO operations.

instance_state

The current serving state of the Cloud SQL instance. Because there are seven possible states, seven data points are returned. Each of them has a different field value representing each state. Only the one that matches the current state of the instance is TRUE. All the others are FALSE. The state can be one of the following: RUNNING: The instance is running, or is ready to run when accessed. SUSPENDED: The instance is not available, for example due to problems with billing. RUNNABLE: The instance has been stopped by owner. It is not currently running, but it’s ready to be restarted. PENDING_CREATE: The instance is being created. MAINTENANCE: The instance is down for maintenance. FAILED: The instance creation failed. UNKNOWN_STATE: The state of the instance is unknown.

memory/quota

Maximum RAM size in bytes.

memory/total_usage

Total RAM usage in bytes. This metric reports the RAM usage of the database process, including the buffer/cache.

memory/usage

RAM usage in bytes. This metric reports the RAM usage of the server, excluding the buffer/cache.

memory/utilization

The fraction of the memory quota that is currently in use.

network/connections

Number of connections to databases on the Cloud SQL instance. Only applicable to MySQL and SQL Server.

network/received_bytes_count

Delta count of bytes received through the network.

network/sent_bytes_count

Delta count of bytes sent through the network.

replication/log_archive_failure_count

Number of failed attempts for archiving replication log files.

replication/log_archive_success_count

Number of successful attempts for archiving replication log files.

replication/network_lag

Indicates time taken from primary binary log to IO thread on replica. Only applicable to replicas.

replication/replica_lag

Number of seconds the read replica is behind its primary (approximation).

replication/state

The current serving state of replication.

state

The current serving state of the Cloud SQL instance. This can be one of the following: RUNNING: The instance is expected to be running. If an instance experiences unplanned (non-maintenance) downtime, the state will still be RUNNING, but the database/up metric will report 0. SUSPENDED: The instance is not available, for example, due to problems with billing. RUNNABLE: The instance has been stopped by the owner. It is not currently running, but it’s ready to be restarted. PENDING_CREATE: The instance is being created. MAINTENANCE: The instance is down for maintenance. FAILED: The instance creation failed or an operation left the instance in an unknown bad state. UNKNOWN_STATE: The state of the instance is unknown.

up

Indicates if the server is up or not.

uptime

Delta count of the time in seconds the instance has been running.

MySQL databases

Metric type prefix: cloudsql.googleapis.com/database/mysql/

Metric

Description

innodb_buffer_pool_pages_dirty

Number of unflushed pages in the InnoDB buffer pool.

innodb_buffer_pool_pages_free

Number of unused pages in the InnoDB buffer pool.

innodb_buffer_pool_pages_total

Total number of pages in the InnoDB buffer pool.

innodb_data_fsyncs

Delta count of InnoDB fsync() calls.

innodb_os_log_fsyncs

Delta count of InnoDB fsync() calls to the log file.

innodb_pages_read

Delta count of InnoDB pages read.

innodb_pages_written

Delta count of InnoDB pages written.

queries

Delta count of statements executed by the server.

questions

Delta count of statements executed by the server sent by the client.

received_bytes_count

Delta count of bytes received by MySQL process.

replication/last_io_errno

The error number of the most recent error that caused the I/O thread to stop.

replication/last_sql_errno

The error number of the most recent error that caused the SQL thread to stop.

replication/seconds_behind_master

Number of seconds the read replica is behind its primary (approximation).

replication/slave_io_running

Indicates whether the I/O thread for reading the primary’s binary log is running. Possible values are Yes, No and Connecting.

replication/slave_io_running_state

Indicates whether the I/O thread for reading the primary’s binary log is running. Possible values are Yes, No and Connecting, and the values are exposed through the ‘state’ field.

replication/slave_sql_running

Indicates whether the SQL thread for executing events in the relay log is running.

replication/slave_sql_running_state

Indicates whether the SQL thread for executing events in the relay log is running. Possible values are Yes / No, and the values are exposed through the ‘state’ field.

sent_bytes_count

Delta count of bytes sent by MySQL process.

PostgreSQL databases

Metric type prefix: cloudsql.googleapis.com/database/postgresql/

Metric

Description

blocks_read_count

Number of disk blocks read by this database. The source field distingushes actual reads from disk versus reads from buffer cache.

deadlock_count

Number of deadlocks detected for this database.

execution_time

Accumulated query execution time per user per database. This is the sum of cpu time, io wait time, lock wait time, process context switch, and scheduling for all the processes involved in the query execution.

io_time

Accumulated IO time per user per database.

latencies

Query latency distribution per user per database.

lock_time

Accumulated lock wait time per user per database.

row_count

Total number of rows affected during query execution.

shared_blk_access_count

Shared blocks (regular tables & indexed) accessed by statement execution.

execution_time

Accumulated execution times per user per database per query.This is the sum of cpu time, io wait time, lock wait time, process context switch, and scheduling for all the processes involved in the query execution.

io_time

Accumulated IO time per user per database per query.

latencies

Query latency distribution per user per database per query.

lock_time

Accumulated lock wait time per user per database per query.

row_count

Total number of rows affected during query execution.

shared_blk_access_count

Shared blocks (regular tables & indexed) accesssed by statement execution.

execution_time

Accumulated execution times per user per database per tag.This is the sum of cpu time, io wait time, lock wait time, process context switch, and scheduling for all the processes involved in the query execution.

io_time

Accumulated IO write time per user per database per tag.

latencies

Query latency distribution per user per database per tag.

lock_time

Accumulated lock wait time per user per database per tag.

row_count

Total number of rows affected during query execution.

shared_blk_access_count

Shared blocks (regular tables & indexed) accessed by statement execution.

num_backends

Number of connections to the Cloud SQL PostgreSQL instance.

num_backends_by_state

Number of connections to the Cloud SQL PostgreSQL instance, grouped by its state.

replication/replica_byte_lag

Replication lag in bytes. Reported from the master per replica.

transaction_count

Delta count of number of transactions.

transaction_id_count

Delta count of transaction ID.

transaction_id_utilization

Current utilization represented as a percentage of transaction IDs consumed by the Cloud SQL PostgreSQL instance. Values are typically numbers between 0.0 and 1.0. Charts display the values as a percentage between 0% and 100%.

tuple_size

Number of tuples (rows) in the database.

tuples_processed_count

Number of tuples(rows) processed for a given database for operations like insert, update or delete.

vacuum/oldest_transaction_age

Age of the oldest transaction yet to be vacuumed in the Cloud SQL PostgreSQL instance, measured in number of transactions that have happened since the oldest transaction.

SQLServer databases

Metric type prefix: cloudsql.googleapis.com/database/sqlserver

Metric

Description

audits_size

Tracks the size in bytes of stored SQLServer audit files on an instance.

audits_upload_count

Counts total number of SQLServer audit file uploads to a GCS bucket and whether or not an upload was successful.