Postgres (beta)

Connection overview. Requires: CLI v0.50.0 and Data Collector v14147 or newer

Integrating Monte Carlo with Postgres allows you to monitor your data assets through custom SQL monitors, which can be created in either the UI wizard and/or programmatically via monitors as code (API/SDK too). These monitors can be used to generate notifications (incidents) to relevant stakeholders and circuit break pipelines.

Integration Setup

To connect Monte Carlo to a Postgres database, follow these steps:

  1. Enable network connectivity between the database and Monte Carlo's data collector.
  2. Create a read-only service account with the appropriate permissions on your database.
  3. Provide service account credentials to Monte Carlo (requires Using the CLI).

1. Enable network connectivity

Follow the Network Connectivity guide to IP Allowlist or VPC peer to provide access to Postgres.

2. Create a read-only service account

πŸ“˜

Prerequisites

To create a service account, you will need admin credentials to your Postgres database.

Please run the SQL snippet below on your Postgres database to create a read-only service account for Monte Carlo

CREATE ROLE montecarlo WITH LOGIN PASSWORD '<PASSWORD>';

-- Grant access to all current tables. Repeat for all relevant schemas (e.g. public, etc.)
-- Select permissions are necessary to create custom SQL monitors.
-- To get a list of all schemas available:
---- SELECT schema_name FROM information_schema.schemata;

GRANT USAGE ON SCHEMA <schema> TO montecarlo;
GRANT SELECT ON ALL TABLES IN SCHEMA <schema> TO montecarlo;

-- Grant access to all future tables. Repeat for all relevant users who create tables in each schema.
-- Select permissions are necessary to create custom SQL monitors.
-- To get a list of all users available:
---- SELECT usename FROM pg_catalog.pg_user;

ALTER DEFAULT PRIVILEGES FOR ROLE <creating_user> IN SCHEMA <schema> GRANT SELECT ON TABLES TO montecarlo;

3. Provide service account credentials to Monte Carlo

  1. Please follow this guide to install and configure the CLI.
  2. Please use the command montecarlo integrations add-postgres to connect. For reference, see help here.
montecarlo integrations add-postgres \
	--host example.cluster-123456789.us-east-1.rds.amazonaws.com \
	--user montecarlo \
	--password -1 \
	--database sample \
	--name artemis-dev

Monitor Support

Below are the supported monitors for the Postgres Integration today. Please reach out to your Monte Carlo representative if you have requirements for additional Monitors.

CategoryMonitor TypeSupport
Automated Anomaly DetectionFreshness
Automated Anomaly DetectionVolume
Automated MonitoringSchema Changes
Opt-in MonitorSQL Rule:white-check-mark:
Opt-in MonitorComparison Rule:white-check-mark:
Opt-in MonitorField Quality Rule
Opt-in MonitorFreshness Rule
Opt-in MonitorVolume Rule
Opt-in MonitorField Health Monitor
Opt-in MonitorDimension Tracking
Opt-in MonitorJSON Schema Changes

FAQs

What is the minimum supported version?

Monte Carlo supports Postgres 10 and newer.

Are cloud variants of Postgres like AWS Aurora, GCP Cloud SQL, and Azure Database supported?

Yes, AWS Aurora, GCP Cloud SQL, and Azure Database for Postgres are all supported.

Are other forks or variants supported?

Variants like Greenplum, Supabase or others may work -- contact us.

What hosting solutions are supported?
This integration supports any instance that is reachable from the AWS cloud (e.g. AWS hosted, site-to-site VPN with AWS, publicly accessible, etc). Please see the networking docs for more detail.

How do I list all schemas (for setup)?

Run the following SQL snippet:

SELECT schema_name FROM information_schema.schemata;

How do I list all users (for setup)?

Run the following SQL snippet:

SELECT usename FROM pg_catalog.pg_user;