pganalyze quickstart
This quickstart guide will help you get started monitoring your Crunchy Bridge database with pganalyze. We recommend you start with the Container Apps Quickstart to get a general understanding of Container Apps.
About pganalyze
pganalyze provides deep analytics and insights into your Postgres database performance and surfaces areas you can improve.
pganalyze with container apps quickstart
First, make sure you have Container Apps enabled. As a user with superuser
privileges, run CREATE EXTENSION pgpodman;
to install the extension in the
postgres
database of the desired cluster.
Next, configure your cluster to enable file logging by adding config parameters
using the dashboard with these values:
log_destination=syslog,stderr
log_line_prefix='%m [%p] %q[user=%u,db=%d,app=%a] '
Or by running
cb config-param set --cluster <ID> postgres:log_destination=syslog,stderr postgres:log_line_prefix='%m [%p] %q[user=%u,db=%d,app=%a] '
Finally, find your cluster's database URL to include as the DATABASE_URL
parameter when you run the container. You can find the URL in the Connection
section of the cluster dashboard (choose the application
role), or by running
cb uri --role application <cluster name>
on the command line.
You will also need to locate your API key from pganalyze to include in the command.
To start the pganalyze collector, run the following using your own values for
DB_URL
and PGA_API_KEY
:
SELECT run_container('-dt -e DB_URL="your-database-URL" -e PGA_API_KEY="your-API-key" --privileged quay.io/pganalyze/collector:stable');
The collector should be sending data to pganalyze within about 10 minutes. Visit the pganalyze documentation for more tuning of pganalyze.