Skip to content

Commit

Permalink
doc/developer: update tokio-console guide docs
Browse files Browse the repository at this point in the history
  • Loading branch information
teskje authored and benesch committed Dec 11, 2022
1 parent 81116d3 commit 3c194ef
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 22 additions & 9 deletions doc/developer/guide-tokio-console.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@
# Developer guide: `tokio-console`

This guide details how to run `tokio-console` with `materialized`
This guide details how to run `tokio-console` with Materialize.

## Overview

First, install `tokio-console`:
First, install `tokio-console`. We require support for Unix domain sockets, [which is still pending
upstream][uds-pr], so we need to install from a fork for now.

```
cargo install tokio-console
```text
cargo install tokio-console --git https://github.com/MaterializeInc/console.git
```

Then run `environmentd`:

```
```text
./bin/environmentd --tokio-console
```

(note that this may slow down `environmentd` a lot, as it increases the amount of tracing by a lot,
and may inadvertently turn on debug logging for `rdkafka`)
(Note that this may slow down `environmentd` a lot, as it increases the amount of tracing by a lot,
and may inadvertently turn on debug logging for `rdkafka`.)

Then, in a different tmux pane/terminal, run:
In the output of the above command, take note of the `tokio-console` listen addresses for the
different processes, e.g.:

```text
environmentd: [...] INFO mz_ore::tracing: starting tokio console on http://127.0.0.1:6669
compute-cluster-u1-replica-1: [...] INFO mz_ore::tracing: starting tokio console on /var/folders/30/[...]3ee9
compute-cluster-s1-replica-2: [...] INFO mz_ore::tracing: starting tokio console on /var/folders/30/[...]f5b6
compute-cluster-s2-replica-3: [...] INFO mz_ore::tracing: starting tokio console on /var/folders/30/[...]7af2
```
tokio-console

Then, in a different tmux pane/terminal, run the `tokio-console` command with the listen address of
your process of interest:

```text
tokio-console <listen-address>
```

This [README] has some docs on how to navigate the ui.

[uds-pr]: https://github.com/tokio-rs/console/pull/388
[README]: https://github.com/tokio-rs/console/tree/main/tokio-console

### Notes on compilation times:
Expand Down
2 changes: 1 addition & 1 deletion src/ore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ hyper = { version = "0.14.23", features = ["http1", "server"], optional = true }
hyper-tls = { version = "0.5.0", optional = true }
opentelemetry = { git = "https://github.com/MaterializeInc/opentelemetry-rust.git", features = ["rt-tokio", "trace"], optional = true }
opentelemetry-otlp = { git = "https://github.com/MaterializeInc/opentelemetry-rust.git", optional = true }
console-subscriber = { git = "https://github.com/benesch/tokio-console.git", branch = "uds", optional = true }
console-subscriber = { git = "https://github.com/MaterializeInc/console.git", optional = true }
sentry-tracing = { version = "0.29.0", optional = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/ore/src/tracing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ where
if let Some(console_config) = config.tokio_console {
let endpoint = match console_config.listen_addr {
SocketAddr::Inet(addr) => format!("http://{addr}"),
SocketAddr::Unix(addr) => addr.to_string(),
SocketAddr::Unix(addr) => format!("file://localhost{addr}"),
};
tracing::info!("starting tokio console on {endpoint}");
}
Expand Down

0 comments on commit 3c194ef

Please sign in to comment.