Step 1: Test Log Download

Log Insights works by continuously fetching your Postgres log files from AWS, classifying log lines, and submitting log data and statistics to pganalyze. The RDS configuration usually does not require any additional configuration beyond the steps you performed as part of basic setup, so we can proceed directly to testing the integration.

You can test whether the collector can actually access your RDS logs correctly by running the following:

sudo pganalyze-collector --test --reload

If this works, you will see output like this:

I [server1] Testing statistics collection...
I [server1]   Test submission successful (106 KB received, server abc123)
I [server1] Testing activity snapshots...
I [server1]   Test submission successful (2.12 KB received, server abc123)
I [server1] Testing log collection (Amazon RDS)...
I [server1]   Test submission successful (86 Bytes received, server abc123)
I [server1]   Log test successful
I Successfully reloaded pganalyze collector (PID 123)

The collector will start sending logs shortly.

If you are getting an error, it sometimes helps to run the test with the -v flag to show all details:

sudo pganalyze-collector --test -v

The collector will only collect log data when you have an Amazon RDS host name specified (the instance name is auto-detected), or you manually specify the aws_db_instance_id andaws_region settings.

In addition, you need to ensure that AWS APIs can be accessed either by using the EC2 metadata service, or by manually specifying the aws_access_key_id and aws_secret_access_keysettings.

In case you get permission errors, make sure your IAM user has the appropriate policy associated.

You will then see Log Insights data on your database within a few minutes:

Screenshot of pganalyze Log Insights feature

We recommend that you also tune a few configuration parameters to get useful log output from Postgres.


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