Atatus Database Monitoring offers comprehensive monitoring for your AWS RDS (Relational Database Service) PostgreSQL databases, providing valuable insights into key metrics like 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. Follow these steps to configure Database Monitoring for your PostgreSQL database:

Before You Begin

Enable and Configure PostgreSQL Monitoring Settings

Update the following parameters in your DB parameter group to enable performance monitoring with Atatus. For detailed guidance on these parameters, refer to the PostgreSQL documentation.
Restart the PostgreSQL server for the parameter changes to take effect.
This restarts your database, not the Atatus agent. Every open connection is dropped and the database is unavailable while it comes back, usually for a minute or two. Do it in a maintenance window.shared_preload_libraries and track_activity_query_size are static parameters, so the parameter group applies but does nothing until the reboot. The other settings on this page are dynamic and take effect without one.On a Multi AZ instance the reboot fails over to the standby unless you pass --no-force-failover, which changes which availability zone your writer is in. On this DB instance, reboot the instance, and note that doing so triggers a failover.
If you cannot take the downtime now, everything except query metrics still works. CREATE EXTENSION succeeds either way, which is why a missed reboot looks like a working setup with an empty query list rather than an error.

Setup Database Access for the Agent

  • To connect to the database, use a superuser account (or one with the necessary privileges). For example, for the postgres database, connect as the postgres superuser using psql:

Postgres ≥ 15

  1. Create the atatus user and grant basic permissions:
  2. Give the atatus user permission to relevant tables:
  3. Create the following schema in every database:
    To collect data or custom metrics that require querying additional tables, you may need to grant the SELECT permission on those tables to the atatus user. For example: grant SELECT on TABLE_NAME to atatus;. Refer to the PostgreSQL custom metric collection documentation for more details.
  4. Create the function in every database to enable the Agent to collect explain plans.

Postgres ≥ 10

  1. Create the atatus user and grant basic permissions:
  2. Create the following schema in every database:
    To collect data or custom metrics that require querying additional tables, you may need to grant the SELECT permission on those tables to the atatus user. For example: grant SELECT on TABLE_NAME to atatus;. Refer to the PostgreSQL custom metric collection documentation for more details.
  3. Create the function in every database to enable the Agent to collect explain plans.

Postgres 9.6

  1. Create the atatus user and grant basic permissions:
  2. Create the following schema in every database:
  3. Create functions in every database to enable the Agent to read the full contents of pg_stat_activity and pg_stat_statements:
    To collect data or custom metrics that require querying additional tables, you may need to grant the SELECT permission on those tables to the atatus user. For example: grant SELECT on TABLE_NAME to atatus;. Refer to the PostgreSQL custom metric collection documentation for more details.
  4. Create the function in every database to enable the Agent to collect explain plans.

Verify

To verify the permissions are correct, run the following commands to confirm the Agent user is able to connect to the database and read the core tables:

Configure Atatus Infrastructure Agent

You can connect without storing a password at all. On RDS and Aurora, the agent can authenticate with a short-lived IAM token that it signs from its own instance or task role. See Managed Authentication.
  1. To enable Database Monitoring for your databases, You should install the Atatus Infrastructure agent in your host machine.
  2. Copy the PostgreSQL example configuration file.
  3. Update PostgreSQL Configuration File:
Add the following configuration to /etc/atatus-infra-agent/conf.d/postgresql.d/postgresql.yml:
  1. Restart the atatus infrastructure agent and PostgreSQL service.

Collecting Schemas (Optional)

To collect schema information from PostgreSQL databases, enable the collect_schemas option in your configuration. Use the auto_discovery option to automatically detect and collect from all logical databases, no need to specify them individually.

Collecting Custom Metrics (Optional)

To collect custom metrics from PostgreSQL, configure the custom_queries section in your postgresql.d/postgresql.yml file.