The open-source pgAudit extension in AlloyDB for PostgreSQL lets you selectively record and track SQL operations performed against your databases. Detailed session and object audit logs help you monitor database activity and meet government, financial, and ISO compliance requirements.
Overview
Database auditing in AlloyDB is available through the pgAudit extension, which monitors and records a configurable subset of executed SQL commands and queries. In contrast, Cloud Audit Logs records administrative and maintenance operations performed on an AlloyDB instance, as described in Monitor access using audit logs.
Limitations
The following limitations apply to the pgAudit functionality:
Creation and processing of audit log records is asynchronous. You might experience a small delay before audit records are available in Cloud Logging. You can monitor the current size of the pending audit data, which can indicate the extent of the delay, using the
alloydb.googleapis.com/node/database/logging/audit/backlog_bytes_countmetric in Cloud Monitoring. For more information, see Monitor audit log pipeline status.When pgAudit is enabled and configured, the creation rate of audit log records depends on your configuration and workload activity.
The system is designed to support a maximum log ingestion rate of 90 MiB per second.
When log generation rate exceeds the platform's ingestion capacity, logs are buffered locally. Sustained backpressure can result in the following:
- Higher latency between audit events and records visible in Cloud Logging.
- Instance restarts or crashes resulting from local disk space exhaustion.
- Intermittent gaps in processed and persisted audit log trails.
The maximum size for a single audit record is 1MB.