pgDash Integration Guide
pgDash - Overview
pgDash is a monitoring and diagnostics tool for PostgreSQL databases. It collects detailed metrics from PostgreSQL servers using pgmetrics and lets you define warning and critical alert rules at the server, database, table, index, tablespace, and query levels. The AlertOps integration receives pgDash webhook notifications and turns them into AlertOps alerts, enabling automated escalations and notifications to the appropriate on-call responders through SMS, voice calls, push notifications, and email.
Prerequisites
📌 Before You Begin
- An active AlertOps account with Owner, App Admin, or Integrations Admin permissions to create and configure inbound API integrations.
- Access to a pgDash account with permissions to manage alert rules and notification settings, and at least one PostgreSQL server already reporting to pgDash. See pgDash Getting Started.
- The AlertOps integration API URL, generated when you create the pgDash API integration in AlertOps.
Configuration StepsPart A: In AlertOps - Create the API Integration
- In AlertOps, navigate to Services+Integrations → Inbound Integrations.
- Switch to API Integration.
- Use the search bar to search for pgDash and select the integration template.
- Enter an integration name, such as pgDash, then click Add Integration.
- Select an Escalation Policy to determine the escalation policy for incoming alerts.
- In the Who section, enter the names of the recipient group(s) and recipient user(s) who should receive the alerts.
- Under Advanced Settings → Rules for Opening and Closing an alert, set Source to pgDash.
- Click Save and copy the API URL using the COPY button. You will need this URL when configuring pgDash.
Part B: In pgDash - Configure pgDash to Send Alerts to AlertOps
pgDash sends alerts to AlertOps through a webhook. For full details, follow pgDash’s guides: Alerts and Webhooks.
Step 1: Add the AlertOps webhook
- In pgDash, click Alerts in the top menu.
- Scroll down to Notification Settings.
- Paste the AlertOps API URL in the Post to a Webhook field.
- To apply the same settings to all servers, click Go next to Copy the above notification settings to all servers.
Note: Clicking Go overwrites the existing notification settings on all other servers.
Step 2: Create an alert rule
- On the Alerts page, under Add New Rule, select a tab: Server, Database, Table, Index, Tablespace, or Query.
- Select a rule and enter the threshold value, for example Database size is greater than 1 MiB.
- Under For servers, select the server(s) the rule applies to.
- Click Add Warning or Add Critical. The rule appears under Existing Rules.
Note: pgDash evaluates alert rules each time it receives a new pgmetrics report and sends a webhook only when the alert status of a server changes. 
![]()
Quick Note:
Once the integration is added in AlertOps, navigate to the What section and remove the values Warn and Crit from the Close Alert When option. This ensures that alerts are properly closed when pgDash sends an empty array in the payload for closed alerts.
Key Data Fields Required for Mapping
pgDash sends one webhook per server containing a list of its active alerts. When an alert fires, the alerts list contains one entry per triggered rule, each with a type of warn or crit. When all alerts return to normal, pgDash sends the same payload with an empty alerts list. Because both notifications contain the same server value, AlertOps can match the clearing notification to the open alert.
|
AlertOps Alert Field |
Read From |
Purpose and behaviour |
|
Source Name |
Static value |
Identifies the alerts as coming from pgDash. |
|
Source Id |
<server> |
Uniquely identifies the pgDash server. Used to ignore duplicates and to match the clearing notification to the open alert. |
|
Subject |
Static text with <server> |
Displays the alert title in AlertOps and notifications. |
|
Open Alert When |
Body, Contains Any: warn, crit |
Opens an alert in AlertOps when pgDash reports at least one warning or critical alert. |
|
Close Alert When |
Body, Does Not Contain: warn, crit |
Closes the open alert with the same Source Id when all pgDash alerts for the server have returned to normal. |
Sample payload
{"version": 1,"server": "test-server","reported": 1793381632,"alerts": [{"type": "crit","text": "Database size is greater than 1 MiB","value": "7.7 MiB","objname": "postgres","objlink": "https://app.pgdash.io/server/test-server/db/postgres"},{"type": "crit","text": "Database size is greater than 1 MiB","value": "7.4 MiB","objname": "neondb","objlink": "https://app.pgdash.io/server/test-server/db/neondb"}]}
Troubleshooting tip: If the request appears in the Inbound Log but no alert is created, inspect the mapping status and the payload. A successfully received request does not necessarily mean an alert was created. You can refer to this article: Inbound Log - Mapping Status.