tokio-console debugs asynchronous Rust programs built on Tokio. A subscriber streams task data over gRPC while a terminal UI explores runtime behavior like a task top view.
Overview
tokio-console is a diagnostics stack for async Rust, especially Tokio-based applications. It streams structured runtime data from an instrumented program to tools that visualize tasks, polls, and related metrics.
The design splits responsibilities: protobuf and gRPC define the wire protocol, console-subscriber collects data inside your process as a tracing Layer, and the tokio-console binary is an interactive terminal client. Other clients, including graphical ones, could consume the same API.
To use it you enable Tokio’s unstable cfg, install console-subscriber in your app, and ensure tokio and runtime tracing targets run at TRACE. The default server listens on localhost port 6669; the CLI accepts a different host or port when needed.
The terminal UI aims for a top-like overview of tasks plus per-task detail views. On Windows, UTF-8 terminal support such as Windows Terminal is recommended. Bundled examples include a demo app and a small dump utility for the data stream.
Key features
- gRPC/protobuf diagnostic wire protocol
- console-subscriber tracing integration
- Interactive tokio-console TUI
- Per-task inspection views
- Configurable console server address
- Works with Tokio unstable instrumentation
- Example instrumented demo program
- dump.rs CLI for raw stream capture
Use cases
- Inspect live Tokio task scheduling
- Debug stalled or hot async tasks
- Compare runtime behavior during development
- Capture diagnostic streams for analysis
- Teach async Rust runtime internals