- Configure MySQL Performance Schema Settings
- Setup Database Access for the Agent
- Configure Atatus Infrastructure Agent
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 theatatus user and grant basic permissions:
EXPLAIN_STATEMENT procedure to enable the agent to collect explain plans.
YOUR_SCHEMA with the appropriate schema name.
Configure Atatus Infrastructure Agent
- 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).
-
Copy the MySQL example configuration file:
-
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, or127.0.0.1:3306if connecting through the Cloud SQL Auth Proxy. -
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, notlocalhost:
Collecting Schemas (Optional)
To collect schema information from your Cloud SQL instance, configure theschemas_collection options:
Collecting Custom Metrics (Optional)
To collect custom metrics, use thecustom_queries option: