Atatus Database Monitoring offers comprehensive monitoring for your Google Cloud SQL for MySQL instances, providing valuable insights into query performance, query samples, execution plans, connection details, system statistics, and InnoDB storage engine telemetry. To enable Database Monitoring, the Agent gathers telemetry by accessing the database as a read-only user. The Atatus Infra Agent runs on a separate VM that connects to your Cloud SQL instance over a private IP, public IP, or the Cloud SQL Auth Proxy.

Before You Begin

Database Monitoring requires at least 16 GB of RAM on the Cloud SQL instance.

Configure MySQL Performance Schema Settings

In the Google Cloud Console, open your Cloud SQL instance and edit its Database flags. Add the following flags, then restart the instance for changes to take effect.

For MySQL 5.7 and 8.0+

For MySQL 5.6

Setup Database Access for the Agent

Create the atatus user and grant basic permissions:
Create the following schema:
Procedure to Enable Events Statements Consumers:
Create the EXPLAIN_STATEMENT procedure to enable the agent to collect explain plans.
Additionally, create this procedure in every schema from which you want to collect explain plans. Replace YOUR_SCHEMA with the appropriate schema name.
Grant access for InnoDB index metrics:
[Optional] To collect and visualize database configuration and schema details in MySQL, grant the following privileges:

Configure Atatus Infrastructure Agent

  1. Install the Atatus Infrastructure agent on a host that can reach your Cloud SQL instance (via private IP, public IP, or the Cloud SQL Auth Proxy).
  2. Copy the MySQL example configuration file:
  3. Update the MySQL configuration file: Add the following configuration to /etc/atatus-infra-agent/conf.d/mysql.d/mysql.yml:
    Replace <INSTANCE_IP> with the Cloud SQL instance’s private/public IP, or 127.0.0.1:3306 if connecting through the Cloud SQL Auth Proxy.
  4. Restart the Atatus Infra Agent:

Connecting via Cloud SQL Auth Proxy (Optional)

If you connect through the Cloud SQL Auth Proxy, point the agent at the proxy’s local address and override the reported hostname so metrics are tagged to the underlying instance, not localhost:

Collecting Schemas (Optional)

To collect schema information from your Cloud SQL instance, configure the schemas_collection options:

Collecting Custom Metrics (Optional)

To collect custom metrics, use the custom_queries option: