pganalyze Collector

The pganalyze collector periodically queries your database and sends metrics and metadata (as "snapshots") to the pganalyze app. For details on setting up the collector, see the collector installation guide. The collector is open-source and the code is available on GitHub.

For an overview of the collector configuration settings, see the Collector Settings page.

Security

Keeping your data safe is very important to us. We take a number of precautions to minimize the data we have access to, and to limit our level of access to that data. The collector is the only pganalyze component that talks directly to your database. In our recommended configuration, the collector uses a database role with limited access, and can only read system statistics and metadatait cannot actually query your data, or modify your database.

For retrieving database statistics, the collector connects to your database on the port you specify (default 5432) using the standard Postgres protocol. When using a managed database service, such as Amazon RDS, the collector will also connect to your provider's API using secure HTTPS connections.

For sending statistics data to the hosted pganalyze service, the collector connects to the pganalyze API at api.pganalyze.com on port 443, as well as to Amazon S3 at s3.amazonaws.com on port 443.

The collector makes only outbound connections, it does not listen on any ports. The only exception to this is the Heroku-based setup, where the collector listens on the dyno's PORT for Heroku to consider the application running, as well as to receive database logs by serving as a Heroku log drain.

Data collection and Snapshot submission Frequency

The pganalyze collector gathers metrics and metadata through various "snapshots", each with specific cadences. This section explains the types of data collected and when different snapshot types are sent.

There are three different types of snapshots that are sent to the pganalyze app.

  • Compact Activity Snapshot: Sent every 10 seconds
  • Compact Logs Snapshot:
    • Streaming: Sent approximately every 10 seconds
    • Download: Sent every 30 seconds
  • Full Snapshot: Sent every 10 minutes (logged as just "snapshot")

Successful submissions are logged as follows:

Submitted compact snapshots successfully: 5 activity, 2 logs
Submitted full snapshot successfully

These snapshots include metrics and metadata collected according to specific schedules and serve the following purposes:

DataCollection IntervalSnapshot TypeFeatures
ConnectionsEvery 10 secondsCompact ActivityConnections
Query StatsEvery 1 minuteFullQuery Performance
Other StatsEvery 10 minutesFullSchema Statistics, System, Index Advisor, VACUUM Advisor
Logs (Streaming)Every 10 secondsCompact LogsLog Insights, EXPLAIN plans
Logs (Download)Every 30 secondsCompact LogsLog Insights, EXPLAIN plans

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