PostgreSQL

The PostgreSQL Integration allows you to ingest and monitor the performance and health metrics of your object-relational database management system (ORDBMS) data. This integration is useful for tracking the total number of blocks read into memory, identifying disk space utilization per table, tallying insert operations, and rollbacks triggered.

Prerequisites

Middleware Host Agent (MW Agent) must be installed on your local machine. To install the MW Agent, see our Installation Guide.

Setup

Step 1: Create Database Credentials

Create a .yaml file containing database credentials like the below example:

/home/ubuntu/postgres_creds.yaml

Step 2: Access Integrations

Log in to Middleware, navigate to the Installations Page in the bottom left corner, select All Integration and click PostgreSQL

Step 3: Enable Integration

Add a host machine from the dropdown list, input the credential path from Step 1, and Save

Visualize Your Data

Default PostgreSQL Dashboard

Once the PostgreSQL integration setup is complete, a new PostgreSQL-specific dashboard will appear in the Dashboard Builder. This default dashboard serves as a jumping off point for visualizing and analyzing PostgreSQL data.

Create PostgreSQL Widget

PostgreSQL data can be added to dashboards as a custom widget. When adding a new widget, select the postgresql data source to view a full list of available PostgreSQL data.

Alerts

Alerts can be configured for any PostgreSQL metrics. When creating a new rule select the Database detection method and PostgreSQL database type for available metrics to appear in the Metrics dropdown list. Select the desired metric and continue configuring the alert conditions.

Metrics Collected

MetricDescription
postgresql.backendsNumber of backends
postgresql.bgwriter.buffers.allocatedNumber of buffers allocated
postgresql.bgwriter.buffers.writesNumber of buffers written
postgresql.bgwriter.checkpoint.countNumber of checkpoints performed
postgresql.bgwriter.durationTotal time spent in checkpoint processing writing and syncing files to disk, in milliseconds
postgresql.bgwriter.maxwrittenNumber of times the background writer stopped a cleaning scan because it had written too many buffers
postgresql.blocks_readNumber of disk blocks read
postgresql.commitsNumber of transactions that have been committed
postgresql.connection.maxConfigured maximum number of client connections allowed
postgresql.database.countCount of databases in a cluster
postgresql.db_sizeDatabase disk size
postgresql.index.scansNumber of index scans on a table
postgresql.index.sizeSize of the index on disk
postgresql.operationsNumber of db row operations
postgresql.rollbacksNumber of rollbacks
postgresql.rowsNumber of rows in the database
postgresql.table.countNumber of user tables in a database
postgresql.table.sizeDisk space used by a table
postgresql.table.vacuum.countNumber of times a table has been manually vacuumed

Troubleshooting

Missing Integrations Menu

If you do not see the Integrations Menu in Middlware, that means your account has not been granted Installation permissions. Contact your system administrator to add the Installation permission to your user role in Settings.

Next Steps

Need assistance or want to learn more about Middleware? Contact our support team in Slack.