# chdig

> TUI interface for debugging and monitoring ClickHouse databases with top-like views and flamegraph analysis

Stars: 301 · Categories: System

- Repository: https://github.com/azat/chdig
- Website: https://github.com/azat/chdig/blob/main/Documentation/Features.md
- Page: https://www.trmn.sh/tools/chdig

## Install

- Homebrew: `brew install chdig`
- Scoop: `scoop bucket add extras && scoop install extras/chdig`
- Cargo: `cargo build`

## Overview

chdig is a terminal user interface (TUI) tool for debugging and monitoring ClickHouse databases. It provides a top-like interface that aggregates ClickHouse's introspection capabilities into a single interactive view, making it easier to diagnose performance issues and monitor database activity without remembering numerous system tables and queries.

The tool includes flamegraph visualization for CPU, memory, and live profiling directly in the terminal using flamelens integration. It supports sharing flamegraphs via pastila.nl and speedscope, exporting Perfetto traces, and visualizing query execution pipelines. Users can share logs and analysis results through integrated web services, making collaboration on performance issues more accessible.

chdig supports cluster-wide monitoring with the `--cluster` flag to aggregate data from multiple hosts, and historical analysis using `--history` to include rotated system log tables. It maintains compatibility with clickhouse-client options and configuration files, including connection parameters. The tool targets database administrators, developers, and SREs who need to regularly investigate ClickHouse performance and operational issues.

### Installation

```bash
# via Homebrew
brew install chdig
```

```bash
# via Scoop
scoop bucket add extras && scoop install extras/chdig
```

```bash
# via Cargo
cargo build
```

![chdig TUI demonstration](https://github.com/azat/chdig/releases/download/v26.1.1/chdig-v26.1.1.gif)

## Alternatives

- [tuptime](https://www.trmn.sh/tools/tuptime.md): System uptime tracking tool that preserves historical uptime/downtime statistics across reboots with detailed reporting (Python, 318 stars)
- [countryfetch](https://www.trmn.sh/tools/countryfetch.md): A neofetch-like CLI tool that displays information about countries including flags, demographics, and geographic data. (283 stars)
- [cy](https://www.trmn.sh/tools/cy.md): Terminal multiplexer with time-travel replay, fuzzy finding, and Janet configuration language (226 stars)
- [kbt](https://www.trmn.sh/tools/kbt.md): Terminal-based keyboard testing tool for checking key functionality across multiple layouts (Rust, 391 stars)
- [cotp](https://www.trmn.sh/tools/cotp.md): Command-line TOTP/HOTP authenticator with encrypted database and interactive dashboard for two-factor authentication codes (394 stars)

---

Canonical: https://www.trmn.sh/tools/chdig
