Viewing information about your Cloud SQL instance

This page describes how to get information about your Cloud SQL instances, including instance summary information, usage data, operation logs, and database logs.

Viewing instance summary information

You can view summary information about your Cloud SQL instances in the Google Cloud Console, or by using the gcloud command-line tool, or the API.


  1. Go to the Cloud SQL Instances page in the Google Cloud Console.

    Go to the Cloud SQL Instances page

  2. Hover over the status icon to the left of an instance name to see the current instance state.
  3. Click an instance name to open its Instance details page.


gcloud sql instances describe [INSTANCE_NAME]


Before using any of the request data below, make the following replacements:

  • project-id: The project ID
  • instance-id: The instance ID

HTTP method and URL:


To send your request, expand one of these options:

You should receive a JSON response similar to the following:

  "kind": "sql#instance",
  "state": "RUNNABLE",
  "databaseVersion": "MYSQL_5_7",
  "settings": {
    "authorizedGaeApplications": [],
    "tier": "db-f1-micro",
    "kind": "sql#settings",
    "pricingPlan": "PER_USE",
    "replicationType": "SYNCHRONOUS",
    "activationPolicy": "ALWAYS",
    "ipConfiguration": {
      "authorizedNetworks": [],
      "ipv4Enabled": true
    "locationPreference": {
      "zone": "asia-east1-a",
      "kind": "sql#locationPreference"
    "dataDiskType": "PD_SSD",
    "backupConfiguration": {
      "startTime": "08:00",
      "kind": "sql#backupConfiguration",
      "enabled": true,
      "binaryLogEnabled": true
    "settingsVersion": "13",
    "storageAutoResizeLimit": "0",
    "storageAutoResize": true,
    "dataDiskSizeGb": "10"
  "etag": "etag-id",
  "ipAddresses": [
      "type": "PRIMARY",
      "ipAddress": ""
  "serverCaCert": {
    "kind": "sql#sslCert",
    "certSerialNumber": "0",
    "cert": "certificate-id",
    "commonName": "C=US,O=Google\\, Inc,CN=Google Cloud SQL Server CA,dnQualifier=dn-qualifier-id",
    "sha1Fingerprint": "sha-id",
    "instance": "instance-id",
    "createTime": "2019-06-28T22:46:35.052Z",
    "expirationTime": "2029-06-25T22:47:35.052Z"
  "instanceType": "CLOUD_SQL_INSTANCE",
  "project": "project-id",
  "serviceAccountEmailAddress": "",
  "backendType": "SECOND_GEN",
  "selfLink": "",
  "connectionName": "project-id:region:instance-id",
  "name": "instance-id",
  "region": "asia-east1",
  "gceZone": "asia-east1-a"
To see how the underlying REST API request is constructed for this task, see the APIs Explorer on the instances:get page.

Viewing instance metrics in Cloud SQL

Cloud SQL provides usage charts of key instance metrics that you can use to monitor your instances. When working with metric data, keep the following facts in mind:

  • A data point for a metric is an aggregate over all of the databases hosted by the instance.
  • Data is reported in Coordinated Universal Time (UTC).
  • Rendered charts do not refresh automatically; to see new data, you must refresh the page.
  • There is a delay of a few minutes between when metric data is recorded and the time it is displayed in the usage charts.

To view instance usage information:

  1. Go to the Cloud SQL Instances page in the Google Cloud Console.

    Go to the Cloud SQL Instances page

  2. Click an instance name to open its Instance details page.
  3. In the metric selection box, select a metric to view its usage chart.

    Screenshot showing dropdown for metric selection.

Comparing metrics from multiple instances

  1. Go to the Cloud SQL Instances page in the Google Cloud Console.

    Go to the Cloud SQL Instances page

  2. Select up to 5 instances you want to compare by checking the checkbox to the left of the instance name.
  3. In the Info Panel on the right, select the Monitoring tab.
  4. Select the metric you want to compare from the metric dropdown.

    You can see the exact data for a specific time by hovering over the graph.

Available metrics

The usage charts can help you respond proactively as your application needs change. From these metrics, you can gain insight into issues of throughput and latency as well as instance usage costs.

Storage usage (GB)

You can use the storage usage metric to help you understand your storage costs. For more information about storage usage charges, see Storage and Networking Pricing.

Point-in-time recovery (PITR) uses write-ahead log (WAL) archiving. These logs update regularly, and use storage space. Write-ahead logs are automatically deleted with their associated automatic backup, which generally happens after about 7 days.

If the size of your write-ahead logs are causing an issue for your instance, you can increase your storage size, but the write-ahead log size increase in disk usage might be temporary. To avoid unexpected storage issues, we recommend enabling automatic storage increases when using PITR.

To delete the logs and recover storage, you can disable point-in-time recovery. Note, however, that decreasing the storage used does not shrink the size of the storage provisioned for the instance.

Temp data is included in the storage usage metric. Temp data is removed as part of maintenance and is allowed to increase beyond user-defined capacity limits to avoid a disk full event, at no charge to the user.

A newly created database uses about 100 MB for system tables and files.

CPU usage

You can use this metric to monitor whether your instance has sufficient CPU for your application's needs. If this value is running too high, you can increase the size of your machine type to give your instance more CPU capability.

Memory usage

The amount of memory being used by your instance.

Read/write operations

The Number of Reads metric is the number of read operations served from disk that do not come from cache. You can use this metric to help you understand whether your instance is correctly sized for your environment. If needed, you can move to a larger machine type to serve more requests from cache and reduce latency.

The Number of Writes metric is the number of write operations to disk. Write activity is generated even if your application is not active, because Cloud SQL instances write to a system table approximately every second (except for replicas).

Active connections Number of open connections to the Cloud SQL instance.
Ingress/Egress bytes (bytes/sec) The amount of network traffic coming into or leaving the instance.
Transactions/sec The number of transactions that have been committed or rolled back on the instance. These values correspond to the xact_commit and xact_rollback statistics.
Instance state The state of your instance is indicated by the status icon, next to the instance name. You can also monitor the metric.

Figure 1 points out the different parts of a usage chart.

Graph showing example Cloud SQL metric data.
Figure 1: Example instance usage data


  • Callout 1: The metric data displayed in the chart.

  • Callout 2: The time range for which to view the metric data.

  • Callout 3: The value of the metric at the cursor.

  • Callout 4: The data cursor. Use the cursor to find the value of a metric at a specific time.

Viewing instance usage data using Cloud Monitoring

If you need a metric not shown in the Instance details page, or more flexibility with your data format or display options, you can use Cloud Monitoring to get information about your Cloud SQL instance.

For a complete list of Cloud SQL metrics provided by Cloud Monitoring, see the Cloud SQL metrics list. For more information about using Cloud Monitoring with Google Cloud, see the Cloud Monitoring documentation.

Viewing instance operations log

You can view the logs for an instance in the Operations pane. The Operations pane logs every operation performed on the instance with the following information:

  • The time the operation completed, reported in your local time zone.
  • The type of operation.
  • The status of the operation.
  • A message describing the outcome the operation.

If the operation fails, you can use the message to troubleshoot the problem.

To view an instance operations log:

  1. Go to the Cloud SQL Instances page in the Google Cloud Console.

    Go to the Cloud SQL Instances page

  2. Click an instance name to open its Instance details page.
  3. Click Operations to change to the pane showing the operation log.
Note: The operations log does not include operations performed using external management tools, such as the psql client. Only user management and password change operations performed using the Google Cloud Console, gcloud command-line tool, or the Cloud SQL Admin API appear in the operations log.

Viewing log files

You can use the Logs Viewer in the Google Cloud Console to view error and log files.

  1. Go to the Logs Viewer in the Google Cloud Console.

    Go to the Logs Viewer

  2. Select the logs you want to see.

    You can filter based on:

    • Instance
    • Log file
    • Log level
    • Date

For more information about selecting and filtering logs, see Viewing Logs. For information about exporting logs, see Exporting Logs.

What's next