pgSentinelDocumentation

Complete guide to the professional pgbalancer management and monitoring platform. Real-time metrics, Prometheus integration, Grafana dashboards, and deep PostgreSQL analytics.

Real-Time Monitoring
30+ Metrics
22 Grafana Panels
pg_stat_insights

Key Features

Comprehensive monitoring and management capabilities

Real-Time Monitoring

Live dashboard with WebSocket updates every 5 seconds

  • Interactive Next.js 14 dashboard with React 18
  • WebSocket live updates for instant metric refresh
  • Beautiful UI with Tailwind CSS and Recharts
  • Real-time connection pool visualization

Prometheus Integration

30+ custom metrics with full PromQL support

  • Custom metrics for pgbalancer performance
  • System resource monitoring (CPU, memory, disk)
  • PostgreSQL-specific metrics and insights
  • Time-series data collection and storage

Grafana Dashboards

22 pre-built visualization panels

  • Professional dashboards for system metrics
  • pg_stat_insights visualization panels
  • Configurable time ranges and queries
  • Custom panel creation and sharing

pg_stat_insights

Deep PostgreSQL performance analytics

  • Query performance analysis and optimization
  • Table and index usage statistics
  • Cache hit ratio monitoring
  • Intelligent recommendations and alerts

REST API

25+ endpoints for programmatic control

  • FastAPI backend with async support
  • Comprehensive API documentation
  • WebSocket support for real-time data
  • Python and TypeScript client libraries

Docker Ready

8-service stack with one-command deployment

  • Complete Docker Compose orchestration
  • Production-ready container configuration
  • Automatic health checks and restarts
  • Volume persistence and network isolation

Architecture Overview

8-service Docker Compose stack for complete monitoring

Frontend Layer

Modern React-based user interfaces with real-time updates

Next.js Dashboard (port 3000)Marketing Website (port 3002)

Backend Layer

High-performance Python backend with async support

FastAPI + uvicorn (port 8000)WebSocket serverpg_stat_insights integration

Monitoring Layer

Complete observability stack with metrics collection and visualization

Prometheus (port 9090)Grafana (port 3001)Alertmanager (port 9093)Node Exporter (port 9100)

Data Layer

Primary database with caching and performance extensions

PostgreSQL (port 5432)Redis (port 6379)pg_stat_statements extension

Quick Start

Get pgSentinel running in minutes with Docker Compose

Terminal Commands
# Clone the repository
git clone https://github.com/pgelephant/pgsentinel.git
cd pgsentinel
# Configure environment
cp env.template .env
# Edit .env with your PostgreSQL connection details
# Start all services
docker-compose up -d
# Access the dashboard
# Dashboard: http://localhost:3000
# API: http://localhost:8000/docs
# Grafana: http://localhost:3001 (admin/admin)
# Prometheus: http://localhost:9090

Ready to Get Started?

Explore the complete pgSentinel documentation and start monitoring your PostgreSQL infrastructure today.