Getting RDS PostgreSQL Logs Into Honeycomb | Honeycomb

We use cookies or similar technologies to personalize your online experience & tailor marketing to you. Many of our product features require cookies to function properly.

Read our privacy policy I accept cookies from this site

Getting RDS PostgreSQL Logs Into Honeycomb

Amazon’s Relational Database Service (RDS) lets you use a number of databases without having to administer them yourself.

Agentless Integration for PostgreSQL Logs 

This integration is a Lambda function subscribed to your instance’s RDS Log Group. It parses log events as they arrive and submits them to Honeycomb. Note that configuring your RDS instance to send its logs to Cloudwatch will incur additional AWS costs - see the Cloudwatch Pricing docs for details.

Before You Install the Agentless Integration 

Before installing the integration, configure your RDS PostgreSQL instance to output queries in its log file. Refer to Amazon’s documentation on setting Parameter Groups to get started.

Set the following option in the Parameter Group:

  • log_min_duration_statement to 0
  • log_statement to none

If you switch to a new Parameter Group when you make these changes, make sure you restart the database.

Next, enable publishing of PostgreSQL slow query logs to AWS Cloudwatch Logs. You can do this in the RDS console in the instance configuration. See the AWS docs for full details. After the change, verify that logs are being received by Cloudwatch Logs via the Cloudwatch Logs Console.

Install the Agentless Integration for PostgreSQL Logs 

The PostgreSQL integration exists as an AWS Lambda function deployed in your AWS account. It subscribes to the Cloudwatch Log Group created by RDS, parses log lines, and submits them as events to Honeycomb. You can view the source here.

To install the integration, you will need:

  • Access to your AWS account’s CloudFormation console
  • Permission to create an IAM role in your AWS account
  • Your Honeycomb API key

To get started, click this AWS quick-create link. This will launch the Cloudformation Stack creation wizard and will prompt you for a few key inputs:

  • The PostgreSQL Cloudwatch Log Group(s) you wish to monitor for events.
  • Your Honeycomb API key (optionally encrypted).
  • The dataset that will be the destination for log events.

Did you find what you were looking for?