Terminal interface for debugging and monitoring ClickHouse databases with introspection tools and flamegraphs
chdig is a terminal user interface (TUI) tool for debugging and monitoring ClickHouse databases. It consolidates ClickHouse's extensive introspection capabilities into a single interface, functioning as a "top" command for database systems. The tool addresses the challenge of remembering and accessing ClickHouse's numerous diagnostic tools by providing a unified view.
The tool offers CPU, memory, and live flamegraph visualization directly in the terminal, leveraging the flamelens library for performance profiling. Users can share flamegraphs and logs via pastila.nl integration, and visualize query pipelines using viz.js. It supports cluster-wide monitoring with the --cluster flag to aggregate data from all hosts, and historical analysis through --history to include rotated system log tables.
chdig maintains compatibility with clickhouse-client options and configuration files, including connection parameters. Database administrators, DevOps engineers, and developers working with ClickHouse would use this tool for performance troubleshooting, system monitoring, and general database introspection. The tool requires ClickHouse version 21.2 or newer and can be used both for debugging specific issues and routine system monitoring.
# via Homebrew
brew install chdig
# via Scoop
scoop bucket add extras && scoop install extras/chdig
# via Cargo
cargo build
