Monitoring 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. Click CREATE CREDENTIALS > Service account.

    SelectServiceAccount

  3. On the Create service account page, enter a unique name for the service account, and click CREATE AND CONTINUE.

  4. Select a role or create a custom one which contains at least the following permissions:

    • monitoring.timeSeries.list
    • cloudsql.instances.list

    To create a custom role, complete the following steps:

    1. From the navigation menu, click Roles > CREATE ROLE.
    2. Enter the title of the role, and click ADD PERMISSIONS.
    3. Add the basic permissions that are mentioned previously, which are required for the role, and click CREATE.
  5. Select the account you created from the list of service accounts.

  6. Select the KEYS tab, and click ADD KEY.

  7. Select Create new key and select the key type as JSON, and then click CREATE.

serviceaccountkey

You need to record the location of the credential file where it is saved to complete the integration.

  1. Add a field credentials_path to the configuration.yml file with the path to the credentials file. For example, see configuration.

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

Configuration

You can configure the Google Cloud SQL metrics poll rate in seconds by adding the following configuration to the configuration file of the GCP Agent:

com.instana.plugin.gcp.sql:
  enabled: true
  poll_rate: 60   # in seconds
  credentials_path: '/opt/instana/credentials/cred-gcp.json' # Path to Service Account credentials

Metrics collection

To view the metrics, select Infrastructure in the sidebar of the Instana User interface, click a specific monitored host, and then you can see a host dashboard with all the collected metrics and monitored processes.

Configuration data

  • Database version
  • Instance state
  • Region
  • Zone
  • Tier
  • Instance type
  • Master instance name
  • Slave IO running
  • Slave SQL running

Performance metrics

Metric Description
Available for failover This is > 0 if the failover operation is available on the instance.
CPU reserved cores Number of cores reserved for the database.
CPU usage time Cumulative CPU usage time in seconds.
CPU utilization The fraction of the reserved CPU that is currently in use.
Used disk Data utilization in bytes.
Disk quota Maximum data disk size in bytes.
Disk read operations Disk read IO operations rate.
Disk utilization The fraction of the disk quota that is currently in use.
Disk write ops Disk write IO operations rate.
Memory quota Maximum RAM size in bytes.
Memory usage RAM usage in bytes.
Memory utilization The fraction of the memory quota that is currently in use.
MySQL InnoDB buffer pool pages dirty Number of unflushed pages in the InnoDB buffer pool.
MySQL InnoDB buffer pool pages free Number of unused pages in the InnoDB buffer pool.
MySQL InnoDB buffer pool pages total Total number of pages in the InnoDB buffer pool.
MySQL InnoDB data fsyncs InnoDB fsync() calls rate.
MySQL InnoDB os log fsyncs InnoDB fsync() calls to the log file rate.
MySQL InnoDB pages read InnoDB pages read rate.
MySQL InnoDB pages written InnoDB pages written rate.
MySQL queries Statements executed by the server rate.
MySQL questions Statements executed by the server sent by the client rate.
MySQL replication/seconds behind master Number of seconds the read replica is behind its master (approximation).
MySQL sent bytes Sent bytes by MySQL process rate.
MySQL received bytes Received bytes by MySQL process rate.
PostgreSQL num backends Number of connections to the Cloud SQL PostgreSQL instance.
PostgreSQL transactions Number of transactions.
Network connections Number of connections to the Cloud SQL MySQL instance.
Network received Received bytes rate through the network.
Network sent Sent bytes rate through the network.

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. We use the following options to gather metrics:

  • 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.