Atatus Database Monitoring offers comprehensive monitoring for your Google Cloud SQL for PostgreSQL instances, providing valuable insights into query performance, query samples, execution plans, connection details, and system statistics. 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 host that connects to your Cloud SQL instance via private IP, public IP, or the Cloud SQL Auth Proxy.

Before You Begin

Configure Cloud SQL Database Flags

In the Google Cloud Console, open your Cloud SQL instance and edit its Database flags, then restart the instance.

Setup Database Access for the Agent

Connect to the postgres database as a superuser. On Cloud SQL, the built-in postgres user (or any user with the cloudsqlsuperuser role) can run the following statements.
  1. Create the atatus user:
  2. Create the atatus schema and grant monitoring access in every database you want monitored:
    To collect data or custom metrics that require querying additional tables, grant the SELECT permission on those tables: GRANT SELECT ON TABLE_NAME TO atatus;.
  3. Create the explain function in every database:

Verify

Confirm the atatus user can connect and read the core tables:

Configure Atatus Infrastructure Agent

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

Connecting via Cloud SQL Auth Proxy (Optional)

When connecting through the Cloud SQL Auth Proxy, override the reported hostname so metrics are tagged to the underlying instance:

Collecting Schemas (Optional)

Collecting Custom Metrics (Optional)