Connect with PgHero
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
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:
- Ensure that you have the Monitor with pg_stat_statements extension installed. PgHero uses it for query stats.
- Ensure that you have Docker installed. See Install Docker Engine for instructions.
PgHero is available on DockerHub. To install it, run:
docker pull ankane/pghero
Connect PgHero to Lakebase
- 
Navigate to the Lakebase App by clicking the apps switcher in the top right corner of your workspace. 
- 
Select your database project. 
- 
Click Connect to open the database connection modal. 
- 
Copy the connection string. 
- 
Run this command, replacing $DB_URLwith your Lakebase Postgres connection string:Bashdocker run -ti -e DATABASE_URL='$DB_URL' -p 8080:8080 ankane/pghero
- 
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