3 releases (stable)

Uses new Rust 2024

1.0.1 Apr 15, 2026
1.0.0 Mar 3, 2026
0.1.0 Feb 20, 2026

#353 in Concurrency

Download history 96/week @ 2026-02-26 130/week @ 2026-03-05 181/week @ 2026-03-12 189/week @ 2026-03-19 161/week @ 2026-03-26 93/week @ 2026-04-02 134/week @ 2026-04-09 158/week @ 2026-04-16 82/week @ 2026-04-23 25/week @ 2026-04-30

424 downloads per month
Used in 18 crates (7 directly)

MIT/Apache

9KB

Facade crate that re-exports platform-specific instrumentation: moire-tokio on native targets, moire-wasm on WASM.

Enable the diagnostics feature to activate live push to moire-web.


lib.rs:

Runtime graph instrumentation for Tokio-based Rust systems.

Moiré replaces Tokio's primitives with named, instrumented wrappers. At every API boundary — every lock acquisition, channel send/receive, spawn, and RPC call — it captures the current call stack via frame-pointer walking and interns it as a BacktraceId. The resulting graph of entities (tasks, locks, channels, RPC calls) connected by typed edges (polls, waiting_on, paired_with, holds) is pushed as a live stream to a moire-web dashboard for investigation.

The dashboard shows you which tasks are stuck, what they are waiting on, and exactly where in your code they got there.

Using this crate

Add moire as a dependency and replace Tokio primitives with their moire:: equivalents. The module layout mirrors tokio's, so it is largely a drop-in:

# Cargo.toml
moire = { ..., features = ["diagnostics"] }
#[tokio::main]
async fn main() {
    // No init call needed — moire initializes itself via `ctor`.

    moire::task::spawn("connection_handler", async {
        let mu = moire::sync::Mutex::new("state", MyState::default());
        let (tx, rx) = moire::sync::mpsc::channel("work_queue", 64);
        // ...
    });
}

Run moire-web and point your process at it:

MOIRE_DASHBOARD=127.0.0.1:9119 ./your-binary

Cargo features

Feature Effect
(default, none) All wrappers compile to pass-throughs; no instrumentation overhead.
diagnostics Enables backtrace capture, entity tracking, and live dashboard push.

Without diagnostics, setting MOIRE_DASHBOARD emits a warning and does not connect.

What is instrumented

Platform backends

This crate re-exports the right backend for the current target:

  • native (not(target_arch = "wasm32")) → moire-tokio
  • wasm32moire-wasm (all instrumentation is a no-op; API surface is identical)

Dependencies

~0–1.8MB
~32K SLoC