Step 4: Configure the Collector
Finding your Supabase connection information
The collector currently uses IPv4 to connect to your database, but by default, Supabase’s direct connection is IPv6-only. Therefore, we generally recommend connecting through the Supavisor session pooler (port 5432 on the pooler hostname), rather than the direct connection unless you are already paying for the IPv4 direct connection add-on in your Supabase project.
IPv4 add-on.
You can find your session pooler connection information by clicking on the Get Connected button in the Supabase dashboard:
Then select the Session pooler option under the Direct Connection String tab.
Modify the collector configuration file
The collector configuration file lives in /etc/pganalyze-collector.conf, and looks like this:
[pganalyze]
api_key = your_pga_organization_api_key
[server1]
db_host = aws-0-your-region.pooler.supabase.com
db_port = 5432
db_name = postgres
db_username = pganalyze.your-project-ref
db_password = your_monitoring_user_passwordFill in the values step-by-step:
-
The
api_keycan be found in the pganalyze Settings page for your organization, under the API Access tab - The
db_hostis the Supavisor pooler hostname for your project, of the formaws-0-<region>.pooler.supabase.com. You can find it under Project Settings → Database in the Supabase dashboard (choose the “Session pooler” tab) - The
db_portis5432for the session pooler — do not use port6543, which is the transaction pooler and doesn’t support the session-level features the collector relies on - The
db_nameis the database you want to monitor (postgresby default) - The
db_usernameanddb_passwordshould be the credentials of the monitoring user we created in Step 1. Note the pooler requires the<role>.<project-ref>username format, so this ispganalyze.your-project-ref, not justpganalyze
If you’re paying for Supabase’s IPv4 add-on and prefer to connect directly instead, use the
direct connection hostname (db.<project-ref>.supabase.co) as db_host, drop db_port
(defaults to 5432), and use the plain pganalyze username.
The collector automatically detects that this is a Supabase project from the db_host
suffix, so no further platform-specific configuration is required.
Testing the new configuration
Run the following to make sure the configuration works:
sudo pganalyze-collector --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 →