Skip to main content

Connect with PgHero

Beta

Lakebase Postgres (Autoscaling Beta) is the next version of Lakebase, available for evaluation only. For production workloads, use Lakebase Public Preview. See choosing between versions to understand which version is right for you.

PgHero is an open-source performance monitoring tool for Postgres that helps you find and fix data issues using a dashboard interface. You can use PgHero to monitor your Lakebase Postgres database performance, identify slow queries, analyze query patterns, and get actionable insights to optimize your database operations.

When to use PgHero

Use PgHero when you need:

  • Simple, focused Postgres performance monitoring
  • Identification of long-running queries
  • Detection of tables that require vacuuming
  • Identification of duplicate or missing indexes
  • View of connections by database and user
  • Query explanation, analysis, and visualization
  • Lightweight monitoring without complex configuration
note

Lakebase Postgres doesn't currently support monitoring tools or platforms that require installing an agent on the Postgres host system.

Install PgHero

PgHero supports installation with Docker, Linux, and Rails. This guide shows how to install PgHero with Docker and connect it to your Lakebase Postgres database.

Before you begin:

PgHero is available on DockerHub. To install it, run:

Bash
docker pull ankane/pghero

Connect PgHero to Lakebase

  1. Navigate to the Lakebase App by clicking the apps switcher in the top right corner of your workspace.

  2. Select your database project.

  3. Click Connect to open the database connection modal.

  4. Copy the connection string.

  5. Run this command, replacing $DB_URL with your Lakebase Postgres connection string:

    Bash
    docker run -ti -e DATABASE_URL='$DB_URL' -p 8080:8080 ankane/pghero
  6. Open http://localhost:8080 in your browser to access the PgHero dashboard.

For detailed connection string information, see Postgres clients.

PgHero monitoring features

PgHero provides focused monitoring capabilities:

  • Slow queries: Identify and analyze the slowest queries in your database
  • Query stats: View query execution statistics and performance metrics
  • Index usage: Monitor index efficiency and identify duplicate or unused indexes
  • Table stats: Database table sizes, row counts, and vacuuming requirements
  • Connection stats: View connections by database and user, and analyze connection pools
  • Query analysis: Explain, analyze, and visualize query execution plans
  • Suggestions: Automated recommendations for performance improvements