Check out our new Resources section: Read through our eBooks and learn how customers are using pganalyze. See all resources

Step 3: Configure the Collector

Configuring the collector with Docker

Create your configuration file (e.g. named pganalyze_collector.env) with environment variables like this:

PGA_API_KEY=your-organization-api-key
DB_HOST=your_db.postgres.database.azure.com
DB_NAME=your_database_name
DB_USERNAME=your_monitoring_user@your_db
DB_PASSWORD=your_monitoring_user_password
AZURE_DB_SERVER_NAME=your_db

Fill in the values step-by-step:

  1. The PGA_API_KEY can be found in the pganalyze API keys page for your organization
  2. The DB_HOST is the IP address of your Azure Database for PostgreSQL instance
  3. The DB_NAME is the database on the Azure Database for PostgreSQL instance you want to monitor
  4. The DB_USERNAME and DB_PASSWORD should be the credentials of the monitoring user we created in Step 1
  5. (optional) The AZURE_DB_SERVER_NAME sets your Azure Database server name - this is automatically inferred from DB_HOST and typically not needed

Test snapshot

Then run the following:

docker run --env-file pganalyze_collector.env quay.io/pganalyze/collector:stable 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 →