pgSentinel: PostgreSQL Monitoring Platform
Enterprise monitoring platform with real-time WebSocket updates, Prometheus metrics, Grafana dashboards, and pg_stat_insights analytics
pgSentinel DashboardReal-Time Monitoring
$ docker-compose up -d
✅ Backend APIhttp://localhost:8000
✅ Dashboardhttp://localhost:3000
✅ Grafanahttp://localhost:3001
✅ Prometheushttp://localhost:9090
Real-Time Metrics:
• CPU Usage: 12.5%
• Memory: 45.2%
• Active Connections: 127
• Pool Utilization: 67.8%
• Query Throughput: 1,245 QPS
All services running healthy • 8 containers operational
Real-Time MonitoringPrometheus IntegrationGrafana Dashboardspg_stat_insightsREST APIWebSocket LiveProduction ReadyDocker Optimized
pgSentinel Architecture
8-Service Docker Compose Stack
Frontend Layer
• Next.js 14 Dashboard (port 3000)
• Marketing Website (port 3002)
• WebSocket client for live updates
Backend Layer
• FastAPI + uvicorn (port 8000)
• WebSocket server for metrics
• pg_stat_insights integration
Monitoring Layer
• Prometheus (port 9090) - Metrics storage
• Grafana (port 3001) - Visualization
• Alertmanager (port 9093) - Alerts
• Node Exporter (port 9100) - System metrics
Data Layer
• PostgreSQL (port 5432) - Primary database
• Redis (port 6379) - Cache & sessions
• pg_stat_statements extension
All services orchestrated via Docker Compose with automatic health checks
Complete Monitoring Stack

Why pgSentinel

Real-Time Web Dashboard

Interactive Next.js 14 dashboard with React 18, TypeScript, Tailwind CSS, and Recharts. Live WebSocket updates every 5 seconds for instant visibility.

Prometheus Integration

30+ custom metrics including active connections, CPU/memory usage, pool utilization, query throughput, and backend health with full PromQL support.

Grafana Visualization

2 professional dashboards with 22 panels covering system metrics, pg_stat_insights data, and custom analytics with configurable time ranges.

pg_stat_insights Analytics

Deep PostgreSQL performance analysis including slow queries, cache hit ratios, table bloat, index usage, replication lag, and optimization recommendations.

FastAPI Backend

High-performance Python 3.12 backend with 25+ RESTful endpoints, WebSocket support, Pydantic validation, and asyncpg for PostgreSQL connectivity.

Alert Management

Integrated Alertmanager with configurable routing, grouping, silencing, and notification channels for proactive incident response.

Docker Orchestration

8-service architecture with backend, frontend, website, PostgreSQL, Redis, Prometheus, Grafana, and Alertmanager all orchestrated via Docker Compose.

Production Ready

Complete with health checks, automatic restarts, volume persistence, network isolation, and comprehensive logging across all services.

pgSentinel Platform Architecture

DevOps / SRE / Database Administrators

Frontend Dashboard (Port 3000)

Next.js 14 + React 18 + TypeScript + Tailwind CSS

Real-Time Metrics
• Live Updates
• WebSocket
• Recharts
• Interactive UI
Dashboards
• System Metrics
• Pool Stats
• Node Status
• Custom Charts
Node Management
• Attach/Detach
• Health Check
• Config Editor
• One-Click Ops

Backend API (Port 8000)

FastAPI + Python 3.12 + Uvicorn + WebSocket

REST API
25+ Endpoints
WebSocket
Live Updates
Metrics
30+ Custom
Health
Auto-Check
Prometheus
Port 9090
30+ Custom Metrics
PromQL Queries
Alert Rules
30-Day Retention
Grafana
Port 3001
2 Dashboards
22 Panels
Custom Queries
Visualization
Alertmanager
Port 9093
12 Alert Rules
Routing Config
Grouping
Notifications
PostgreSQL 17
Metadata Storage
Config Storage
pg_stat_insights
Query Analytics
Redis 7
Cache & Sessions
Session Cache
Data Caching
Fast Retrieval
Node Exporter
System Metrics
CPU Metrics
Memory Usage
Disk I/O
pgbalancer Cluster
Connection Pooler & Load Balancer
PostgreSQL Node 1
Primary (5433)
PostgreSQL Node 2
Standby (5434)
PostgreSQL Node 3
Standby (5435)
8-Service Docker Architecture
✓ Frontend
Next.js:3000
✓ Backend
FastAPI:8000
✓ Prometheus
Metrics:9090
✓ Grafana
Dashboards:3001
✓ Alertmanager
Alerts:9093
✓ PostgreSQL
Metadata:5432
✓ Redis
Cache:6379
✓ Node Exporter
System:9100
ComponentTechnologyPurposeKey Features
Frontend DashboardNext.js 14, React 18, TypeScriptReal-time monitoring interfaceLive metrics, WebSocket updates, beautiful UI
Backend APIFastAPI, Python 3.12, asyncpgAPI server & data aggregation25+ endpoints, WebSocket, Pydantic validation
PrometheusPrometheus 2.xMetrics collection & storage30+ custom metrics, PromQL, alerting
GrafanaGrafana 10.xProfessional visualization2 dashboards, 22 panels, custom queries
pg_stat_insightsPostgreSQL extensionsDeep performance analyticsQuery stats, table/index analysis, recommendations
Redis CacheRedis 7Session & data cachingFast retrieval, session management
AlertmanagerPrometheus AlertmanagerAlert routing & notificationRouting, grouping, silencing
Node ExporterPrometheus Node ExporterSystem metrics collectionCPU, memory, disk, network stats

Key Features

📊

Real-Time Dashboard

Beautiful web-based interface with live metrics, connection pool visualization, and backend node management.

📈

Prometheus Metrics

30+ custom metrics exported for comprehensive monitoring with PromQL query support and time-series analysis.

📉

Grafana Dashboards

22 pre-built visualization panels covering all aspects of pgbalancer performance and health.

🔍

pg_stat_insights

Deep PostgreSQL performance insights with query analysis, table stats, index usage, and recommendations.

🔔

Alert Management

Integrated Alertmanager for configurable alerts, notifications, and incident response workflows.

🌐

REST API

Comprehensive FastAPI backend with 25+ endpoints for programmatic control and data access.

WebSocket Live

Real-time updates via WebSocket for instant metric refresh and live event streaming.

🐳

Docker Ready

Production-ready Docker Compose deployment with 8 integrated services and health checks.

🔐

Secure & Scalable

Enterprise-grade security with role-based access, Redis caching, and horizontal scalability.

Get Started

Monitor Your pgbalancer Clusters

Deploy pgSentinel and gain real-time visibility into your PostgreSQL connection pooling infrastructure with professional dashboards and comprehensive analytics.