This page describes how to monitor a Cloud SQL instance.
Cloud SQL offers two ways to monitor an instance:
- In the Google Cloud Console
- In Cloud Monitoring
Cloud SQL instance monitoring in the console
Cloud SQL provides some performance monitoring in the INFO PANEL on the SQL Instances page, and also in the instance overview page for a selected instance. A drop-down menu in those charts presents the following options:
- CPU utilization
- Storage usage
- Memory usage
- Read/write operations
- Ingress/Egress bytes
Additionally, a read replica offers the option
- Go to the Cloud SQL Instances page in the Google Cloud Console.
- Click the instance to open its Instance overview page.
The metrics chart is prominent on the top of the page.
GCP Monitoring includes a default Cloud SQL monitoring dashboard, which includes the most commonly used metrics. You can use this dashboard to monitor the general health of your primary and replica instances. You can also create your own custom dashboards to display data that is of interest to you.
GCP Monitoring also includes many other metrics on its metrics explorer page:
- In the Google Cloud Console, go to Monitoring or use the following button:
Go to Monitoring
- In the Monitoring navigation pane, click Metrics Explorer.
- Enter the monitored resource name in the Find resource type and metric text box.
To view the metrics for a monitored resource using Metrics Explorer, do the following:
For Resource Type select Cloud SQL Database.
Cloud SQL exports the replication lag metrics, as
reported by the databases, as
In addition to the default Cloud SQL dashboard, you can create a custom dashboard to monitor the replication lag for both in-region and cross-region replicas:
- Go to the Monitoring page.
- Select the Dashboards tab.
- Click + CREATE DASHBOARD on the button bar in the top of the page.
- Give the dashboard a name and click OK
- Click ADD CHARTin the upper right-hand corner of the page.
- For Resource Type select Cloud SQL Database
You can also create an alert for when the metric exceeds a given value. See more information on how to use GCP Monitoring.