Google Cloud SQL

Setup

The Instana Google Cloud integration uses Service Accounts to create an API connection between Google Cloud and Instana. Below are instructions for creating the service account and providing Instana the service account credentials to begin making API calls on your behalf.

  1. Navigate to Google Cloud credentials page for the Google Cloud project you would like to setup the Instana integration.
  2. Press Create credentials and then select Service account key
    SelectServiceAccount
  3. In the Service account dropdown, select New service account
  4. Give the service account a unique name
  5. For Role, select:
    Compute engine —> Compute Viewer
    Monitoring —> Monitoring Viewer
    Cloud SQL —> Cloud SQL Viewer
  6. Select JSON as the key type, and press create
  7. Take note where this file is saved, as it is needed to complete the integration
  8. Add field to configuration.yml credentials_path with path to credentials file. (Example in configuration section.)

In order to monitor project(s) the following services need to be enabled:

Sensor (Data Collection)

Tracked Configuration

  • Version
  • CPU
  • Memory
  • Mysql
  • PostgreSQL
  • Replication

Metrics

Metric Description
database/available_for_failover This is > 0 if the failover operation is available on the instance.
database/cpu/reserved_cores Number of cores reserved for the database.
database/cpu/usage_time Cumulative CPU usage time in seconds.
database/cpu/utilization The fraction of the reserved CPU that is currently in use.
database/disk/bytes_used Data utilization in bytes.
database/disk/quota Maximum data disk size in bytes.
database/disk/read_ops_count Delta count of data disk read IO operations.
database/disk/utilization The fraction of the disk quota that is currently in use.
database/disk/write_ops_count Delta count of disk write IO operations.
database/memory/quota Maximum RAM size in bytes.
database/memory/usage RAM usage in bytes.
database/memory/utilization The fraction of the memory quota that is currently in use.
database/mysql/innodb_buffer_pool_pages_dirty Number of unflushed pages in the InnoDB buffer pool.
database/mysql/innodb_buffer_pool_pages_free Number of unused pages in the InnoDB buffer pool.
database/mysql/innodb_buffer_pool_pages_total Total number of pages in the InnoDB buffer pool.
database/mysql/innodb_data_fsyncs Delta count of InnoDB fsync() calls.
database/mysql/innodb_os_log_fsyncs Delta count of InnoDB fsync() calls to the log file.
database/mysql/innodb_pages_read Delta count of InnoDB pages read.
database/mysql/innodb_pages_written Delta count of InnoDB pages written.
database/mysql/queries Delta count of statements executed by the server.
database/mysql/questions Delta count of statements executed by the server sent by the client.
database/mysql/replication/seconds_behind_master Number of seconds the read replica is behind its master (approximation).
database/mysql/sent_bytes_count Delta count of bytes sent by MySQL process.
database/mysql/received_bytes_count Delta count of bytes received by MySQL process.
database/postgresql/num_backends Number of connections to the Cloud SQL PostgreSQL instance.
database/postgresql/transaction_count Delta count of number of transactions.
database/network/connections Number of connections to the Cloud SQL MySQL instance.
database/network/received_bytes_count Delta count of bytes received through the network.
database/network/sent_bytes_count Delta count of bytes sent through the network.

Snapshot

Metric Description
database/mysql/replication/slave_io_running Indicates whether the I/O thread for reading the master’s binary log is running. Possible values are Yes, No and Connecting.
database/mysql/replication/slave_sql_running Indicates whether the SQL thread for executing events in the relay log is running.
database/state The current serving state of the Cloud SQL instance. This can be one of the following.
RUNNABLE: The instance is running, or is ready to run when accessed.
SUSPENDED: The instance is not available, for example due to problems with billing.
PENDING_CREATE: The instance is being created.
MAINTENANCE: The instance is down for maintenance.
UNKNOWN_STATE: The state of the instance is unknown.

Tags

More details on using tags are described here.

Configuration

You can enable/disable the sensor and configure its polling rate it in the agent’s configuration file /opt/instana/agent/etc/instana/configuration.yaml:

com.instana.plugin.gcp.sql:
  enabled: true
  poll_rate: 60
  credentials_path: '/opt/instana/credentials/cred-gce.json'

Aggregation

The Aggregation option lets you combine time series based on common statistics. This results in fewer lines on the chart displaying the metric, which can improve the performance of the chart. All metrics are gathered with following options:

  • Aligner is ALIGN_SUM (Align time series via aggregation. The resulting data point in the alignment period is the sum of all data points in the period.)
  • Reducer is none.
  • Alignment period is one minute.