QueryHawk monitors and visualizes key SQL metrics to help users improve database and query performance. A central dashboard monitors database health. Containers ensure a consistent environment for all users.
Table of Contents
QueryHawk delivers comprehensive SQL database monitoring and visualization, empowering developers and database administrators to optimize performance and quickly identify bottlenecks. Built on industry-standard tools including Prometheus, Grafana, and PostgreSQL Exporter, all containerized with Docker for seamless deployment.
- โ Real-time SQL query analysis with millisecond-precision execution metrics
- โ Complete visibility into query execution plans with detailed buffer and cache statistics
- โ Interactive dashboards for visualizing database health and performance trends
- โ Query comparison tool to benchmark and optimize SQL performance
- โ Track query execution paths across entire application with distributed tracing
With QueryHawk's intuitive interface, teams can proactively manage database performance, reduce troubleshooting time, and make data-driven optimization decisions. The containerized architecture ensures easy deployment across development, staging, and production environments.
Gain insights into your SQL databases and enhance how your team approaches database performance optimization with QueryHawk.
- Execution Plan Visibility: Analyze "EXPLAIN ANALYZE" results with detailed metrics on planning time, execution time, and resource usage.
- Cache Performance Metrics: Monitor cache hit ratios and buffer statistics to identify memory optimization opportunities.
- Query Comparison: Evaluate startup and total costs for queries to understand their impact on database resources.
- Secure Connection Testing: Connect to any PostgreSQL database with SSL support and connection validation.
- Query Performance Profiling: Test queries before deployment with comprehensive performance metrics.
- Historical Comparison: Store and compare query performance over time to track optimization progress.
Once connected, QueryHawk will display multiple metrics, including:
- Transaction rate
- Cache hit ratio
- Active connections
- Tuple operations
- Lock metrics
- I/O statistics
- Index usage
- Transaction commits vs. rollbacks
- Long-running queries
QueryHawk includes distributed tracing capabilities:
- View the Jaeger dashboard embedded in the UI
- Track request flows through your application
- Identify performance bottlenecks
- Debug slow queries
- Docker-based Deployment: Quickly deploy the entire monitoring stack with Docker Compose.
- Secure Authentication: GitHub OAuth integration for secure user management.
- Dynamic Exporters: Automatically create and manage PostgreSQL exporters.
- Docker and Docker Compose
- PostgreSQL database
- GitHub account (for OAuth)
- Clone the repository:
git clone [repository-url]
cd queryhawk
-
Download Docker Desktop, install, and open.
-
Configure environment variables
- Create .env in the root directory
- Input and configure environment variables
# Example fields (please update with your real values for each one)
POSTGRES_URI=postgresql://username:password@hostname:port/database
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
JWT_SECRET=your_jwt_secret
SUPABASE_URI=your_supabase_uri
- Start the services
docker-compose up -d
- Access the application:
Frontend: http://localhost:5173
Steps to create container:
-
Build the Docker Image: docker build -t <image_name>: . Example: docker build -t my-server -f server/Dockerfile .
-
Verify the Image was build: docker images
-
Create and Start a New Container docker run -p <host_port>:<container_port> --name <container_name> Example: docker run -p 4002:4001 my-server
To find containers ID or containers name:
docker ps
To stop container:
docker stop <container_name> or docker stop <container_id>
Optional remove container after stopping it:
docker rm <container_name> or docker rm <container_id>
Rebuilds container:
docker-compose build (name)
Use all container from docker-compose.yml:
docker-compose up
Remove all containers that are running that came from the docker-compose.yml file:
docker-compose down
Stop all containers:
docker stop $(docker ps -aq)
Remove all containers:
docker rm $(docker ps -aq)
Remove all images:
docker rmi $(docker images -q)
remove all volumes:
docker volume rm $(docker volume ls -q)
remove all network volumes:
docker network prune
Remove all dangling resources:
docker system prune -a
- Bryan Cabanin ๐ GitHub | LinkedIn
- Meagan Lewis ๐ฆ GitHub | LinkedIn
- Peter Limburg ๐ชถ GitHub | LinkedIn
- Moe Na ๐ธ GitHub | LinkedIn
We would like to thank the following resources that helped make QueryHawk possible:
- Material-UI - Used for designing UI components
- Excalidraw - Used for designing wireframe and planning
This project is licensed under the MIT License - see the LICENSE file for details.