GCP Cloud SQL Server
You can enable this integration using the Connect a GCP Account option on the Monitor UI.
This integration has 19 metrics.
List of Alerts
Alert | Description | Format |
---|---|---|
[GCP Cloud SQL Server] Database Down | The SQL Server database is down. | Prometheus |
[GCP Cloud SQL Server] No High Availability | The SQL Server database doesn’t have ‘High Availability’ enabled, or there are no available instances in other zones for automatic failover. The service will be down when the instance undergoes maintenance or has any other issues. | Prometheus |
[GCP Cloud SQL Server] High CPU Usage | The CPU usage is reaching the limit. | Prometheus |
[GCP Cloud SQL Server] High Memory Usage | The memory usage is reaching the limit. | Prometheus |
[GCP Cloud SQL Server] Disk Full in 48h | The disk will be full in 48 hours. | Prometheus |
[GCP Cloud SQL Server] Disk Full in 12h | The disk will be full in 12 hours. | Prometheus |
[GCP Cloud SQL Server] Replica Lag | The SQL Server replica is lagging behind its primary instance. This issue is only applicable to replicas. | Prometheus |
[GCP Cloud SQL Server] Network Lag | The time taken from primary binary log to IO thread on replica is high. This issue is only applicable to replicas. | Prometheus |
List of Dashboards
GCP Cloud SQL Server
The dashboard provides information on the GCP Cloud SQL Server integration.
List of Metrics
Metric name |
---|
gcp_cloudsql_database_database_auto_failover_request_count |
gcp_cloudsql_database_database_available_for_failover |
gcp_cloudsql_database_database_cpu_utilization |
gcp_cloudsql_database_database_disk_bytes_used_by_data_type |
gcp_cloudsql_database_database_disk_read_ops_count |
gcp_cloudsql_database_database_disk_utilization |
gcp_cloudsql_database_database_disk_write_ops_count |
gcp_cloudsql_database_database_instance_state |
gcp_cloudsql_database_database_memory_utilization |
gcp_cloudsql_database_database_network_connections |
gcp_cloudsql_database_database_network_received_bytes_count |
gcp_cloudsql_database_database_network_sent_bytes_count |
gcp_cloudsql_database_database_replication_network_lag |
gcp_cloudsql_database_database_replication_replica_lag |
gcp_cloudsql_database_database_replication_state |
gcp_cloudsql_database_database_sqlserver_audits_size |
gcp_cloudsql_database_database_sqlserver_audits_upload_count |
gcp_cloudsql_database_database_up |
gcp_cloudsql_database_database_uptime |
Monitoring and Troubleshooting GCP Cloud SQL Server
This document describes important metrics and queries that you can use to monitor and troubleshoot GCP Cloud SQL Server.
Most of the metrics covered in this document are applicable to all the GCP Cloud SQL integrations (MySQL, PostgreSQL, SQL Server). There is a separate section for MySQL metrics.
The GCP metrics of type DELTA
, which typically have the suffix _count
in their name (but not always), return the cumulative value of 1 minute. They need to be divided by 60 to get the value per second.
Status and Replication
Status
Use the following query to get the status of the database. A value of 1 means UP, and a value of 0 means DOWN.
gcp_cloudsql_database_database_up
Use the following query to get the current serving state of the Cloud SQL instance. The state is stored inside the label state
.
gcp_cloudsql_database_database_instance_state > 0
The state 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 is 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.
Replication
Failover
The following query returns a value > 0 if the failover operation is available on the instance.
gcp_cloudsql_database_database_available_for_failover
Use the following query to get the number of instance auto-failover requests per second.
gcp_cloudsql_database_database_auto_failover_request_count / 60
State
Use the following query to get the current serving state of replication. The state is stored inside the label state
. According to the GCP documentation, this metric is in the BETA launch stage.
gcp_cloudsql_database_database_replication_state > 0
The state can be one of the following:
- RUNNING: Replication is active and running.
- STOPPED: Replication is inactive and stopped.
- ERROR: An error has occurred and replication is stopped.
- SYNCING: The replication is syncing.
- UNSYNCED: The replication is unsynced.
Replica and Network Lag
Use the following query to get the approximate number of seconds the read replica is behind its primary instance. This is only applicable to replicas.
gcp_cloudsql_database_database_replication_replica_lag
The following query indicates time taken from primary binary log to IO thread on replica. This is only applicable to replicas.
gcp_cloudsql_database_database_replication_network_lag
CPU, Memory and Storage
CPU
Use the following query to get the current CPU utilization represented as a percentage of the reserved CPU that is currently in use. The return values are typically numbers between 0 and 1 (but might exceed 1).
gcp_cloudsql_database_database_cpu_utilization
Memory
Use the following query to get the percentage of the memory quota that is currently in use. The return values are numbers between 0 and 1.
gcp_cloudsql_database_database_memory_utilization
Disk
Use the following query to get the percentage of the disk quota that is currently in use. The return values are numbers between 0 and 1.
gcp_cloudsql_database_database_disk_utilization
Use the following query to get the disk usage per data type. The data type is stored inside the label data_type
. According to the GCP documentation, this metric is in the BETA launch stage.
gcp_cloudsql_database_database_disk_bytes_used_by_data_type
Use the following queries to get the disk read and write IO operations per second.
gcp_cloudsql_database_database_disk_read_ops_count / 60
gcp_cloudsql_database_database_disk_write_ops_count / 60
Network
Use the following query to get the number of connections to databases on the Cloud SQL instance. This is only applicable to MySQL and SQL Servers.
gcp_cloudsql_database_database_network_connections
Use the following queries to get the bytes received and sent through the network per second.
gcp_cloudsql_database_database_network_received_bytes_count / 60
gcp_cloudsql_database_database_network_sent_bytes_count / 60
SQL Server Stats
Audits
Use the following query to get the total number of SQLServer audit file uploads per second to a GCS bucket and whether or not an upload was successful. The upload status is stored inside the label upload_status
.
gcp_cloudsql_database_database_sqlserver_audits_upload_count / 60
The following query tracks the size in bytes of stored SQLServer audit files on an instance.
gcp_cloudsql_database_database_sqlserver_audits_size
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.