Step 3: Configure the Collector
Configuring the collector
The collector configuration file lives in /etc/pganalyze-collector.conf
, and looks like this:
[pganalyze]
api_key = your_pga_organization_api_key
[server1]
db_host = 1.2.3.4
db_name = your_database_name
db_username = your_monitoring_user
db_password = your_monitoring_user_password
gcp_project_id = your_gcp_project_id
gcp_cloudsql_instance_id = your_gcp_cloudsql_instance_id
Fill in the values step-by-step:
- The
api_key
can be found in the pganalyze Settings page for your organization, under the API keys tab - The
db_host
is the IP address of your Google Cloud SQL / AlloyDB instance - The
db_name
is the database on the Google Cloud SQL / AlloyDB instance you want to monitor - The
db_username
anddb_password
should be the credentials of the monitoring user we created in Step 1 - The
gcp_project_id
should match the name of the GCP project that contains your Cloud SQL / AlloyDB instance - The
gcp_cloudsql_instance_id
should match the name of the Cloud SQL instance - if using AlloyDB see below
Instructions for Google AlloyDB
If you are using Google AlloyDB, do not specify gcp_cloudsql_instance_id
, but instead specify gcp_alloydb_cluster_id
(set to the name of the cluster) and gcp_alloydb_instance_id
(set to the instance name within the cluster).
Testing the new configuration
Run the following to make sure the configuration works:
sudo pganalyze-collector --test
Once you've confirmed the install is successful and you're receiving query data in pganalyze, we recommend setting up Log Insights as a follow-up step, to automatically track log events in your database.
Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →