Skills2026年5月13日·1 分钟阅读

PgHero — Performance Dashboard for PostgreSQL

PgHero is an open-source web dashboard that gives you instant visibility into PostgreSQL performance, including slow queries, missing indexes, unused indexes, and connection stats.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
PgHero Postgres Dashboard
直接安装命令
npx -y tokrepo@latest install f5441ed2-4eca-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

PgHero surfaces the performance data that PostgreSQL already collects but buries in system views. It turns pg_stat_statements, index usage stats, and connection metrics into a clean web dashboard that helps you find and fix database bottlenecks quickly.

What PgHero Does

  • Ranks queries by total time, calls, and average duration from pg_stat_statements
  • Identifies missing indexes by analyzing sequential scans on large tables
  • Detects unused and duplicate indexes that waste disk and slow writes
  • Monitors active connections, long-running queries, and replication lag
  • Provides space usage breakdowns per table and index

Architecture Overview

PgHero is a Ruby application (usable as a standalone Docker image or a mountable Rails engine) that reads directly from PostgreSQL system catalogs and pg_stat_statements. It requires no additional agents or extensions beyond pg_stat_statements, which ships with PostgreSQL. The dashboard is read-only and adds negligible load.

Self-Hosting & Configuration

  • Enable pg_stat_statements in postgresql.conf (shared_preload_libraries)
  • Set DATABASE_URL as an environment variable pointing to your PostgreSQL instance
  • Deploy via Docker, Linux packages, or embed as a Rails engine
  • Supports monitoring multiple databases from a single dashboard
  • Optional basic auth or integration with your application's authentication

Key Features

  • Zero-agent setup — reads from built-in PostgreSQL stats views
  • Query analysis with suggested indexes for the slowest queries
  • Automatic detection of index bloat, unused indexes, and duplicates
  • Connection and replication monitoring out of the box
  • Supports PostgreSQL, Amazon RDS, and Aurora

Comparison with Similar Tools

  • pgAdmin — general-purpose admin tool; PgHero focuses specifically on performance insights
  • pg_stat_monitor (Percona) — enhanced stats extension; PgHero provides a web UI on top of standard pg_stat_statements
  • Datadog/New Relic — commercial APM with deep Postgres integration; PgHero is free and self-hosted
  • pganalyze — commercial SaaS for query optimization; PgHero covers core use cases at no cost

FAQ

Q: Does PgHero modify my database? A: No. It only reads from system views and pg_stat_statements. It never modifies data or schema.

Q: Can I monitor Amazon RDS instances? A: Yes. Enable pg_stat_statements via an RDS parameter group and point PgHero at the RDS endpoint.

Q: Does it support PostgreSQL on all versions? A: PgHero supports PostgreSQL 10 and newer.

Q: Can I use it without Ruby or Rails? A: Yes. The Docker image runs standalone with no Ruby knowledge required.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产