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, typically in
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.
When the collector is installed in a virtual machine, you can now test and apply the collector configuration (for container environments, simply restart the collector):
sudo pganalyze-collector --test --reload
... I [server1] Testing log collection (Azure Database)... I [server1] Log test successful I Successfully reloaded pganalyze collector (PID 123)
For additional help when you get an error 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 EXPLAIN as 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 →