NEW: Paste your query and schema data and we give you the best index. Launch pganalyze Index Advisor

Step 5: Configure Collector

To complete the setup, we can now go to your virtual machine that is running the collector, and enable access to the Azure Event Hub.

Next, update the collector configuration for this server. Note the values need to match what you created in Step 2.

If using the config file, make the following changes to your pganalyze-collector.conf:

azure_eventhub_namespace: [namespace from step 2]
azure_eventhub_name: [name from step 2]

If running the collector in a container, set these environment variables instead:

  • AZURE_EVENTHUB_NAMESPACE=[namespace from step 2]
  • AZURE_EVENTHUB_NAME=[name from step 2]

Thanks to the Managed Identity that's assigned to the VM, we don't need to specify any credentials here.

Run the collector test to verify the setup works:

sudo pganalyze-collector --test --reload

And you will see this output when its successful:

I [server1] Testing statistics collection...
I [server1]   Test submission successful (29.3 KB received, server abc123)
I [server1] Testing activity snapshots...
I [server1]   Test submission successful (2.44 KB received, server abc123)
I [server1] Testing log collection (Azure Database)...
I [server1]   Log test successful
I Successfully reloaded pganalyze collector (PID 123)

If you get an error here, please check our troubleshooting documentation.

You will start seeing log data in pganalyze Log Insights within a few minutes.

We recommend setting up Log-based EXPLAINas follow-up step, to automatically EXPLAIN slow queries in Postgres.


Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →