Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take 2: Add Jaeger/tracing, Tokio-Console to Sui and wallet runtimes #1068

Merged
merged 19 commits into from
Mar 29, 2022

Conversation

velvia
Copy link
Contributor

@velvia velvia commented Mar 24, 2022

  • Uses the new telemetry module from Mysten-infra
  • Wallet log output now goes to a separate file; CLI output no longer depends on logs
  • Changed some noisy instrumentation to use #[instrument]

Benchmark results

On main:

~/s/m/fastnft (main=) cargo run --release --bin=bench -- --use-move --num-transactions 160000
Total time: 1548046us, items: 160000, tx/sec: 103356.10182126371

On this branch, using default logging settings in bench:

cargo run --release --bin=bench -- --use-move --num-transactions 160000
Total time: 1566819us, items: 160000, tx/sec: 102117.73025473906

@velvia
Copy link
Contributor Author

velvia commented Mar 24, 2022

@gdanezis @oxade @laura-makdah Sorry need you to approve the PR again, I had to re-create it because of issues with my old fork not working anymore. Changes since last time: a bunch of setup code was moved to Mysten-infra, and some inline instrumentation moved to #[instrument] headers for compactness. Thanks!

Also, benchmark results vs main are included.

@velvia velvia requested a review from Clay-Mysten as a code owner March 25, 2022 21:02
Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for pushing this one!
Historic PR at #859 for ref.

deny.toml Outdated
@@ -55,6 +55,10 @@ ignore = [
# no safe upgrade is available, but once one is, we should upgrade Move
# and remove this
"RUSTSEC-2022-0002",
# telemetry component in mysten-infra clashes with crates.io telemetry package
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@Clay-Mysten Clay-Mysten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Evan! Great work. I have a bunch of tiny suggestions and a couple of errors caught.

nested and key-value pairs in spans give context to events or logs inside the function.

* spans and their key-value pairs adds essential context to enclosed logs, such as a transaction ID.
* spans also track time spent in different sections of code, enabling distributed tracing functionality
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow "functionality" with a period to match the other bullet points in this list.

To see nested spans visualized with [Jaeger](https://www.jaegertracing.io), do the following:

1. Run this to get a local Jaeger container: `docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest`
2. Run sui like this (trace enables the most detailed spans): `SUI_TRACING_ENABLE=1 RUST_LOG="info,sui_core=trace" ./sui start`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use 1. for each numbered step and let the numbers be dynamically generated. Try it in preview.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True though in my experience it's also harmless, my editor just does it. However it does work as you say.

### Live async inspection / Tokio Console

[Tokio-console](https://github.com/tokio-rs/console) is an awesome CLI tool designed to analyze and help debug Rust apps using Tokio, in real time! It relies on a special subscriber.

1. Build Sui using a special flag: `RUSTFLAGS="--cfg tokio_unstable" cargo build`
2. Start Sui with `SUI_TOKIO_CONSOLE` set to 1
3. Clone the console repo and `cargo run` to alunch the console
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to launch (spelled as to alunch)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also end sentence with a period to match the others.

Copy link
Contributor

@Clay-Mysten Clay-Mysten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also make sure you have peers test your commands. I will try to get to that in time but don't want to hold you up.

Copy link
Contributor

@Clay-Mysten Clay-Mysten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Evan!

@velvia velvia merged commit a7ab858 into MystenLabs:main Mar 29, 2022
@velvia velvia deleted the ec/add-tracing-subscribers branch March 29, 2022 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants