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

Step 4: Configure Collector

Sign in to your virtual machine, and add the following configuration setting:

gcp_pubsub_subscription: projects/PROJECT_ID/subscriptions/SUBSCRIPTION_ID

This is the value of "Subscription name" you can see when clicking on the details for the Pub/Sub subscriber we created earlier.

Now test the collector configuration:

sudo pganalyze-collector --test --reload

This should return something like the following:

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 (Google Cloud SQL)...
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 EXPLAIN as a 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 →