Docs

Prometheus Setup

Connect dbaBrain to your existing Prometheus instance for PostgreSQL metrics.

Overview

If you already run Prometheus with postgres_exporter, dbaBrain can pull metrics from your existing setup. This avoids duplicate metric collection and lets Sage analyze historical Prometheus data.

Requirements

  • -Prometheus server accessible from dbaBrain (HTTP/HTTPS)
  • -postgres_exporter running and scraping your PostgreSQL instance
  • -Prometheus API enabled (default on port 9090)

Configuration

In dbaBrain Settings > Integrations > Prometheus, provide:

text
Prometheus URL: https://your-prometheus:9090 Authentication: Bearer token or Basic auth (if required) PostgreSQL job name: postgresql (the job_name in your scrape config)

Metrics We Query

dbaBrain queries the following Prometheus metrics:

  • -pg_stat_activity_count - active connections
  • -pg_stat_database_tup_* - tuple operations (inserts, updates, deletes)
  • -pg_stat_database_blks_* - block reads/hits for cache ratio
  • -pg_stat_user_tables_n_dead_tup - dead tuples per table
  • -pg_replication_lag - replication lag in seconds
  • -pg_database_size_bytes - database size
  • -pg_stat_statements_* - query statistics
Even with Prometheus integration, we recommend also connecting directly to PostgreSQL for real-time session analysis and lock detection that Prometheus cannot provide.