Enable pgAuditStay organized with collectionsSave and categorize content based on your preferences.
To enable auditing on an AlloyDB instance, you perform two steps. First, you
enable alloydb.enable_pgaudit flag on the instance. Then, you connect to the
cluster's primary instance and create the pgaudit extension in the databases.
Enable pgAudit on the instance:
Console
In the Google Cloud console, go to theClusterspage.
In theOverviewpage, go toInstances in your cluster,
select an instance, and then clickEdit.
Add thealloydb.enable_pgauditflag on your instance:
ClickAdd flag.
Select thealloydb.enable_pgauditflag from theNew database flaglist.
Selectonfrom theValuelist.
ClickDone.
ClickUpdate instance.
gcloud
Enable pgAudit on an instance by setting that instance'salloydb.enable_pgauditflag toon. For more information on setting an instance's database flags using the Google Cloud CLI, seeConfigure an instance's database flags.
Note that AlloyDB automatically restarts the instance after
you update this flag.
Connect to the primary instance and create the extension in each database.
You must perform the following steps on the primary instance even if you are
enabling auditing on a read pool instance:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-24 UTC."],[],[]]