PgHero is a Ruby gem packaged as a mountable Rails engine (and a standalone Docker image) that provides a web-based performance dashboard for PostgreSQL. In production it connects to one or more databases through dynamically created ActiveRecord subclasses — one connection pool per database — and queries PostgreSQL system catalogs and statistics views (pg_stat_statements, pg_stat_activity, pg_stat_user_indexes, pg_statio_user_tables, pg_stat_progress_vacuum, pg_stat_replication, pg_sequences, and more) to render health checks, space usage and growth, live queries, historical and current query stats, safe EXPLAIN plans, connection breakdowns, maintenance/vacuum state, and server settings. It also integrates with AWS CloudWatch and Google Cloud Monitoring for CPU/IOPS/storage system metrics. Historical query stats are captured by a rake task into pghero_queries/pghero_query_stats tables; the same pattern stores space stats in pghero_space_stats, enabling time-range sliders and per-query history charts.