← Integrations

PostgreSQL & TimescaleDB

Connects today

The relational database you probably already run.

Databases · Database

Connect a database you already run. Plexus queries it live over a read-only connection, through a cache, a circuit breaker and a concurrency ceiling.

What Plexus reads

  • Any table you map: a time column, a value column, and optionally a column that names the thing each row is about
  • The schema, to suggest that mapping instead of asking you to type it

What it does not read

  • Anything you have not mapped. An unmapped connection describes nothing, which is a connection nobody has pointed at a table yet — not a failure
  • Writes of any kind. The connection is read-only

Connecting it

  1. 1Paste a connection string
  2. 2Pick the tables worth tracking

Tutorial

Dashboards and alerts on top of TimescaleDB or Postgres

Connect the database you already run. Plexus queries it live over a read-only connection.

  1. 1

    Create a read-only role. Change the database name and password. The last line covers tables you create later, hypertables included.

    sql
    CREATE ROLE plexus_reader WITH LOGIN PASSWORD 'choose-a-password';
    GRANT CONNECT ON DATABASE telemetry TO plexus_reader;
    GRANT USAGE ON SCHEMA public TO plexus_reader;
    GRANT SELECT ON ALL TABLES IN SCHEMA public TO plexus_reader;
    ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO plexus_reader;
  2. 2

    In Plexus, go to Connections, click Add connection, and pick PostgreSQL or TimescaleDB.

  3. 3

    Paste a connection string for that role. Plexus tries TLS first. Add ?sslmode=require to refuse a connection without it.

    text
    postgresql://plexus_reader:choose-a-password@your-host:5432/telemetry
  4. 4

    Pick the tables worth tracking: a time column, a value column, and optionally the column that names each device.

  5. 5

    Build a dashboard on those tables, and add an alert rule to any of them. Alerts need Pro; dashboards work on Free.

What you’ll see: Charts read straight from your database. Alert rules check new rows every poll and notify you in Slack or by email.

Worth knowing

  • SSH tunnelling to a bastion is supported for databases that are not directly reachable.

Connect it, and the dashboards build themselves from the first data that lands.