Step 5: Configure the Collector
Create your configuration file (e.g. named pganalyze_collector.env) with environment variables like this:
PGA_API_KEY=your_pga_organization_api_key
DB_HOST=your_database_host
DB_PORT=your_database_port
DB_NAME=your_database_name
DB_USERNAME=your_monitoring_user
DB_PASSWORD=your_monitoring_user_passwordFill in the values from the info in your Aiven console:

- The
PGA_API_KEYcan be found in the pganalyze Settings page for your organization, under the API keys tab - The
DB_HOSTis the hostname of your PostgreSQL instance (example.aivencloud.comabove) - The
DB_PORTis the port your PostgreSQL server is running on (12448above) - The
DB_NAMEis the database you want to monitor (defaultdbabove--make sure this is the same database where you created thepg_stat_statementsextension in Step 2) - The
DB_USERNAMEandDB_PASSWORDshould be the credentials of the monitoring user we created in Step 1
Test snapshot
Then run the following:
docker run --env-file pganalyze_collector.env quay.io/pganalyze/collector:stable testOnce 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 →