A terminal UI for Apache Spark performance analysis via the Databricks driver proxy.
- Live job dashboard — ranked by duration, auto-refreshing via background poller
- 16 suspect detectors — flags slow stages, data skew, disk spill, partition count issues, broadcast join opportunities, Python UDF usage, cache opportunities, and more
- Bottleneck classification — identifies Large Scan, Wide Shuffle, and Data Explosion patterns
- SQL correlation — links jobs and stages back to SQL executions with plan hints
- Critical path analysis — annotates the longest-running stage per job with a "CP" marker
- Estimated savings — each suspect includes an estimated time savings to help prioritize fixes
- Drill-down navigation — job list → job detail (stages + bar chart) → SQL plan view
- Help overlay — press
hfor context-sensitive keybinding reference and PySpark recommendations - Smooth scrolling —
tui-scrollviewintegration for fluid scrolling in detail views - Color-coded severity — warning (yellow) and critical (red) indicators at a glance
- PySpark recommendations — each suspect includes concrete PySpark tuning suggestions
- Cross-platform releases — CI/CD builds for Linux, macOS (x86 + ARM), and Windows
- Zero setup — reads credentials from CLI flags, env vars, or
~/.databrickscfg
- Rust toolchain (1.85+ for edition 2024)
- A running Databricks cluster with an active Spark application
git clone https://github.com/tadeasf/spark-tui.git
cd spark-tui
cargo install --path .Provide credentials using any of these methods (highest priority first):
| Method | Host | Token | Cluster ID |
|---|---|---|---|
| CLI flags | --host |
--token |
--cluster-id |
| Environment | DATABRICKS_HOST |
DATABRICKS_TOKEN |
DATABRICKS_CLUSTER_ID |
~/.databrickscfg |
host |
token |
cluster_id |
# With CLI flags
spark-tui --host adb-123.azuredatabricks.net --token dapi... --cluster-id 0123-456789-abcdef
# With environment variables
export DATABRICKS_HOST=adb-123.azuredatabricks.net
export DATABRICKS_TOKEN=dapi...
export DATABRICKS_CLUSTER_ID=0123-456789-abcdef
spark-tui
# With a specific databrickscfg profile
spark-tui --profile my-workspace| Flag | Env Var | Default | Description |
|---|---|---|---|
--host |
DATABRICKS_HOST |
— | Workspace hostname (e.g. adb-123.azuredatabricks.net) |
--token |
DATABRICKS_TOKEN |
— | Personal access token |
--cluster-id |
DATABRICKS_CLUSTER_ID |
— | Cluster ID |
--profile, -p |
DATABRICKS_CONFIG_PROFILE |
auto-detect | Profile name from ~/.databrickscfg |
--poll-interval |
SPARK_TUI_POLL_INTERVAL |
10 |
Refresh interval in seconds |
--event-log-path |
SPARK_TUI_EVENT_LOG_PATH |
— | DBFS path to Spark event log file (historical mode) |
--sparkui-cookie |
SPARK_TUI_SPARKUI_COOKIE |
— | DATAPLANE_DOMAIN_DBAUTH cookie for Spark UI auth |
When a cluster is terminated, spark-tui automatically falls back to historical data using a 4-strategy chain:
- Spark UI REST API — probes the Databricks Historical Spark UI endpoint (requires
--sparkui-cookiefor authenticated environments). If the UI is still warming up (downloading event logs), retries with backoff for ~53 seconds. - Spark History Server — probes known Databricks history server proxy URLs.
- DBFS event logs — reads event logs from the cluster's configured log delivery path or
--event-log-path. - Default DBFS paths — scans well-known DBFS directories for event log files.
The status line shows a HISTORICAL badge when viewing data from a terminated cluster.
For the Spark UI strategy on authenticated Databricks workspaces:
- Open the Spark UI in your browser (Cluster > Spark UI tab)
- Open DevTools (F12) > Application > Cookies
- Copy the value of
DATAPLANE_DOMAIN_DBAUTHfrom theadb-dp-*domain - Pass it via
--sparkui-cookie <value>orSPARK_TUI_SPARKUI_COOKIE=<value>
| Key | Action |
|---|---|
Tab / Shift+Tab |
Switch between Jobs and Suspects tabs |
j / ↓ |
Move selection down |
k / ↑ |
Move selection up |
g / Home |
Jump to top |
G / End |
Jump to bottom |
Enter |
Drill into job detail / stage detail |
s |
Open SQL plan view (from job detail) |
h |
Toggle help overlay (keybinding reference / SQL recommendations) |
Esc |
Go back one level |
q |
Quit |
Full documentation is available at the GitHub Pages site.
Build docs locally:
cargo install mdbook
mdbook serve docs
# Open http://localhost:3000MIT
See Contributing Guide for development setup, testing, and code conventions.