All Integrations
Databasespg_stat_statements + postgres-exporter

PostgreSQL Integration

Deep PostgreSQL observability: query performance, vacuum stats, replication lag, and lock contention. AI-powered slow query detection correlated with application traces.

Setup

How It Works

01

Enable pg_stat_statements

Add pg_stat_statements to shared_preload_libraries in postgresql.conf. This gives TigerOps access to per-query execution counts, total time, and row statistics.

02

Create a Monitoring User

Grant the TigerOps monitoring role read access to pg_stat_* views. The role requires no write access to your application data — only system catalog views.

03

Deploy the PostgreSQL Exporter

Run the TigerOps postgres-exporter as a sidecar. It connects with the monitoring user and exposes metrics for query performance, vacuum, replication, and index usage.

04

AI Query Analysis Activates

TigerOps normalizes and fingerprints query patterns from pg_stat_statements, detects regressions, and correlates slow queries with upstream application traces automatically.

Capabilities

What You Get Out of the Box

Query Performance Monitoring

Per-query execution counts, total time, mean time, and standard deviation from pg_stat_statements. TigerOps automatically detects query regressions and ranks them by impact.

Vacuum & Bloat Analysis

Track autovacuum runs, dead tuple accumulation, table bloat estimates, and TOAST activity. TigerOps alerts when tables approach transaction ID wraparound danger.

Replication Lag

Monitor streaming replication lag in bytes and seconds for all replica nodes. TigerOps alerts on replication slot accumulation that can cause primary disk exhaustion.

Lock Contention Detection

Track lock wait times, deadlock counts, and blocking query chains from pg_locks. TigerOps surfaces which queries are causing lock contention and for how long.

Index Usage Analysis

Identify unused indexes wasting storage and write overhead. TigerOps tracks sequential scans vs index scans per table and flags tables missing optimal indexes.

Connection Pool Monitoring

Track active connections, idle connections, and connection saturation. TigerOps integrates with PgBouncer metrics for full connection pool visibility.

Configuration

pg_stat_statements Configuration

Enable query statistics and configure the TigerOps monitoring user in PostgreSQL.

postgresql.conf + setup.sql
# postgresql.conf — enable query statistics
shared_preload_libraries = 'pg_stat_statements'

# Track all statements (not just top-level)
pg_stat_statements.track = all
pg_stat_statements.max = 10000
pg_stat_statements.track_utility = on

# Enable auto-explain for slow queries (TigerOps ingests EXPLAIN output)
session_preload_libraries = 'auto_explain'
auto_explain.log_min_duration = '500ms'
auto_explain.log_analyze = on
auto_explain.log_format = json

---
-- setup.sql — create TigerOps monitoring role (PostgreSQL 10+)
CREATE USER tigerops_monitor WITH PASSWORD 'your-secure-password';

-- Grant system monitoring access
GRANT pg_monitor TO tigerops_monitor;

-- Grant access to pg_stat_statements
GRANT EXECUTE ON FUNCTION pg_stat_statements_reset() TO tigerops_monitor;

-- For each application database:
GRANT CONNECT ON DATABASE your_app_db TO tigerops_monitor;
\c your_app_db
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
GRANT SELECT ON pg_stat_statements TO tigerops_monitor;

---
# TigerOps postgres-exporter env configuration
DATA_SOURCE_NAME="postgresql://tigerops_monitor:password@postgres:5432/postgres?sslmode=require"
TIGEROPS_ENDPOINT="https://ingest.atatus.net/api/v1/write"
TIGEROPS_API_KEY="${TIGEROPS_API_KEY}"
PG_EXPORTER_DISABLE_DEFAULT_METRICS=false
PG_EXPORTER_EXTEND_QUERY_PATH=/etc/tigerops/pg-queries.yaml
FAQ

Common Questions

Does TigerOps support managed PostgreSQL services like RDS, Aurora, and Supabase?

Yes. TigerOps works with any PostgreSQL-compatible service including AWS RDS PostgreSQL, Aurora PostgreSQL, Google Cloud SQL, Azure Database for PostgreSQL, Supabase, and Neon. The exporter connects over standard PostgreSQL protocol with no host-level access required.

What permissions does the TigerOps monitoring user need?

The monitoring user needs CONNECT on your database, SELECT on pg_stat_statements, and membership in the pg_monitor role (PostgreSQL 10+). For older versions: SELECT on pg_stat_activity, pg_stat_replication, pg_stat_bgwriter, and pg_locks. No application table access is required.

Can TigerOps detect N+1 query problems in my ORM?

Yes. TigerOps correlates pg_stat_statements query counts with application traces. When it detects that a single user request triggered hundreds of identical queries, it flags the trace with an N+1 warning and links to the specific query pattern.

How does TigerOps handle PostgreSQL query normalization?

TigerOps uses the same query fingerprinting as pg_stat_statements — parameters are replaced with placeholders to group identical query shapes together. This means you see aggregate performance for query patterns, not thousands of individual queries with different parameter values.

Can I monitor multiple PostgreSQL databases in one workspace?

Yes. Deploy one exporter per PostgreSQL instance (or cluster). TigerOps groups them in the UI by environment tag, region, or custom label. Cross-database query correlation and comparison dashboards are available in the TigerOps database observability view.

Get Started

Know What Your Database Is Actually Doing

Query performance, vacuum health, and replication lag in one view. No DBA required.