GCP Cloud SQL

Cloud SQL is the managed relational database service of Google Cloud, running MySQL, PostgreSQL and SQL Server. Each engine has a template for the primary instance and one for its read replicas.

Available solutions

Zabbix version 7.4 7.2 7.0 6.4 6.0
Source: templates/cloud/gcp

GCP Cloud SQL MySQL by HTTP

Overview

This template is designed to monitor Google Cloud Platform Cloud SQL MySQL instances by Zabbix.

Requirements

Zabbix version: 7.4 and higher.

Tested versions

This template has been tested on:

  • GCP Cloud SQL MySQL versions: 8.0, 5.7

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

This template will be automatically connected to discovered entities with all their required parameters pre-defined.

Macros used

Name Description Default
{$GCP.DATA.TIMEOUT}

A response timeout for an API.

15s
{$GCP.TIME.WINDOW}

Time interval for the data requests.

Supported usage type:

1. The default update interval for most of the items.

2. The minimal time window for the data requested in the Monitoring Query Language REST API request.

5m
{$GCP.PROXY}

Sets HTTP proxy value. If this macro is empty then no proxy is used.

{$HTTP.TLS.VERIFY}

TLS certificate verification for script items: "none" - disabled, "peer" - verify the certificate chain and expiration, "full" - full verification. Any other value enables full verification. To override the setting for this template only, define the macro with the context "GCP Cloud SQL MySQL", e.g. {$HTTP.TLS.VERIFY:"GCP Cloud SQL MySQL"}.

full
{$CLOUD_SQL.MYSQL.DISK.UTIL.WARN}

GCP Cloud SQL MySQL instance warning disk usage threshold.

80
{$CLOUD_SQL.MYSQL.DISK.UTIL.CRIT}

GCP Cloud SQL MySQL instance critical disk usage threshold.

90
{$CLOUD_SQL.MYSQL.CPU.UTIL.MAX}

GCP Cloud SQL MySQL instance CPU usage threshold.

95
{$CLOUD_SQL.MYSQL.RAM.UTIL.MAX}

GCP Cloud SQL MySQL instance RAM usage threshold.

90

Items

Name Description Type Key and additional info
Metrics get

MySQL metrics in raw format.

Script gcp.cloudsql.mysql.metrics.get

Preprocessing

  • Check for not supported value: any error

    ⛔️Custom on fail: Discard value

Reserved CPU cores

Number of cores reserved for the database.

Dependent item gcp.cloudsql.mysql.cpu.reserved_cores

Preprocessing

  • JSON Path: $.base_reserved_cores

CPU usage time

Cumulative CPU usage time in seconds.

Dependent item gcp.cloudsql.mysql.cpu.usage_time

Preprocessing

  • JSON Path: $.base_usage_time

CPU utilization

Current CPU utilization represented as a percentage of the reserved CPU that is currently in use.

Dependent item gcp.cloudsql.mysql.cpu.utilization

Preprocessing

  • JSON Path: $.base_utilization

  • Custom multiplier: 100

Disk size

Maximum data disk size in bytes.

Dependent item gcp.cloudsql.mysql.disk.quota

Preprocessing

  • JSON Path: $.mysql_quota

Disk bytes used

Data utilization in bytes.

Dependent item gcp.cloudsql.mysql.disk.bytes_used

Preprocessing

  • JSON Path: $.mysql_bytes_used

Disk read I/O

Delta count of data disk read I/O operations.

Dependent item gcp.cloudsql.mysql.disk.read_ops_count

Preprocessing

  • JSON Path: $.base_read_ops_count

Disk write I/O

Delta count of data disk write I/O operations.

Dependent item gcp.cloudsql.mysql.disk.write_ops_count

Preprocessing

  • JSON Path: $.base_write_ops_count

Disk utilization

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

Shown as percentage.

Dependent item gcp.cloudsql.mysql.disk.utilization

Preprocessing

  • JSON Path: $.mysql_utilization

  • Custom multiplier: 100

Memory size

Maximum RAM size in bytes.

Dependent item gcp.cloudsql.mysql.memory.quota

Preprocessing

  • JSON Path: $.base_quota

Memory used by DB engine

Total RAM usage in bytes.

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

Dependent item gcp.cloudsql.mysql.memory.total_usage

Preprocessing

  • JSON Path: $.base_total_usage

Memory usage

The RAM usage in bytes.

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

Dependent item gcp.cloudsql.mysql.memory.usage

Preprocessing

  • JSON Path: $.base_usage

Memory utilization

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

Shown as percentage.

Dependent item gcp.cloudsql.mysql.memory.utilization

Preprocessing

  • JSON Path: $.base_ram_pused

Network: Received bytes

Delta count of bytes received through the network.

Dependent item gcp.cloudsql.mysql.network.received_bytes_count

Preprocessing

  • JSON Path: $.base_received_bytes_count

Network: Sent bytes

Delta count of bytes sent through the network.

Dependent item gcp.cloudsql.mysql.network.sent_bytes_count

Preprocessing

  • JSON Path: $.base_sent_bytes_count

Connections

Number of connections to the databases on the Cloud SQL instance.

Dependent item gcp.cloudsql.mysql.network.connections

Preprocessing

  • JSON Path: $.base_connections

Instance state

GCP Cloud SQL MySQL Current instance state.

HTTP agent gcp.cloudsql.mysql.inst.state

Preprocessing

  • JSON Path: $.timeSeriesData[0].pointData[0].values[0].stringValue

    ⛔️Custom on fail: Set value to: 10

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 10m

DB engine state

GCP Cloud SQL MySQL DB Engine State.

HTTP agent gcp.cloudsql.mysql.db.state

Preprocessing

  • Check for not supported value: any error

    ⛔️Custom on fail: Discard value

  • JSON Path: $.timeSeriesData[0].pointData[0].values[0].int64Value

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 10m

InnoDB dirty pages

Number of unflushed pages in the InnoDB buffer pool.

Dependent item gcp.cloudsql.mysql.innodb_buffer_pool_pages_dirty

Preprocessing

  • JSON Path: $.mysql_innodb_buffer_pool_pages_dirty

InnoDB free pages

Number of unused pages in the InnoDB buffer pool.

Dependent item gcp.cloudsql.mysql.innodb_buffer_pool_pages_free

Preprocessing

  • JSON Path: $.mysql_innodb_buffer_pool_pages_free

InnoDB total pages

Total number of pages in the InnoDB buffer pool.

Dependent item gcp.cloudsql.mysql.innodb_buffer_pool_pages_total

Preprocessing

  • JSON Path: $.mysql_innodb_buffer_pool_pages_total

InnoDB fsync calls

Delta count of InnoDB fsync() calls.

Dependent item gcp.cloudsql.mysql.innodb_data_fsyncs

Preprocessing

  • JSON Path: $.mysql_innodb_data_fsyncs

InnoDB log fsync calls

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

Dependent item gcp.cloudsql.mysql.innodb_os_log_fsyncs

Preprocessing

  • JSON Path: $.mysql_innodb_os_log_fsyncs

InnoDB pages read

Delta count of InnoDB pages read.

Dependent item gcp.cloudsql.mysql.innodb_pages_read

Preprocessing

  • JSON Path: $.mysql_innodb_pages_read

InnoDB pages written

Delta count of InnoDB pages written.

Dependent item gcp.cloudsql.mysql.innodb_pages_written

Preprocessing

  • JSON Path: $.mysql_innodb_pages_written

Open tables

The number of tables that are currently open.

Dependent item gcp.cloudsql.mysql.open_tables

Preprocessing

  • JSON Path: $.mysql_open_tables

Open table definitions

The number of table definitions that are currently cached.

Dependent item gcp.cloudsql.mysql.open_table_definitions

Preprocessing

  • JSON Path: $.mysql_open_table_definitions

Queries

Delta of statements executed by the server.

Dependent item gcp.cloudsql.queries

Preprocessing

  • JSON Path: $.mysql_queries

Questions

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

Dependent item gcp.cloudsql.questions

Preprocessing

  • JSON Path: $.mysql_questions

Network: Bytes received by MySQL

Delta count of bytes received by MySQL process.

Dependent item gcp.cloudsql.mysql_received_bytes_count

Preprocessing

  • JSON Path: $.mysql_received_bytes_count

Network: Bytes sent by MySQL

Delta count of bytes sent by MySQL process.

Dependent item gcp.cloudsql.mysql_sent_bytes_count

Preprocessing

  • JSON Path: $.mysql_sent_bytes_count

Triggers

Name Description Expression Severity Dependencies and additional info
GCP MySQL: High CPU utilization

The CPU utilization is too high. The system might be slow to respond.

min(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.cpu.utilization,5m) >= {$CLOUD_SQL.MYSQL.CPU.UTIL.MAX} Average
GCP MySQL: Disk space is low

High utilization of the storage space.

last(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.disk.utilization) >= {$CLOUD_SQL.MYSQL.DISK.UTIL.WARN} Warning Depends on:
  • GCP MySQL: Disk space is critically low
GCP MySQL: Disk space is critically low

Critical utilization of the disk space.

last(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.disk.utilization) >= {$CLOUD_SQL.MYSQL.DISK.UTIL.CRIT} Average
GCP MySQL: High memory utilization

RAM utilization is too high. The system might be slow to respond.

min(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.memory.utilization,5m) >= {$CLOUD_SQL.MYSQL.RAM.UTIL.MAX} High
GCP MySQL: Instance is in suspended state

The instance is in suspended state.
It is not available, for example, due to problems with billing.

last(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.inst.state) = 1 Warning
GCP MySQL: Instance is stopped by the owner

The instance has been stopped by the owner.
It is not currently running, but it's ready to be restarted.

last(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.inst.state) = 2 Info
GCP MySQL: Instance is in maintenance

The instance is down for maintenance.

last(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.inst.state) = 4 Info
GCP MySQL: Instance is in failed state

The instance creation failed, or an operation left the instance in an own bad state.

last(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.inst.state) = 5 Average
GCP MySQL: Instance is in unknown state

The state of the instance is unknown.

last(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.inst.state) = 6 Average
GCP MySQL: Failed to get the instance state

Failed to get the instance state.
Check access permissions to GCP API or service account.

last(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.inst.state) = 10 Average
GCP MySQL: Database engine is down

Database engine is down.
If an instance experiences unplanned (non-maintenance) downtime, the instance state will still be RUNNING, but the database engine state metric will report 0.

last(/GCP Cloud SQL MySQL by HTTP/gcp.cloudsql.mysql.db.state)=0 Average Depends on:
  • GCP MySQL: Instance is stopped by the owner
  • GCP MySQL: Instance is in suspended state
  • GCP MySQL: Instance is in maintenance
  • GCP MySQL: Instance is in failed state
  • GCP MySQL: Instance is in unknown state
  • GCP MySQL: Failed to get the instance state

Articles and documentation

+ Propose new article

Didn't find integration you need?