tracing-tape-recorder

Crates.iotracing-tape-recorder
lib.rstracing-tape-recorder
version
sourcesrc
created_at2024-11-10 13:32:53.228769
updated_at2024-11-19 13:52:44.981425
descriptionTracing subscriber layer for the tracing-tape format
homepagehttps://github.com/soehrl/tracing-tape
repositoryhttps://github.com/soehrl/tracing-tape
max_upload_size
id1442906
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Simon Oehrl (soehrl)

documentation

README

Tracing Tape

Dead-simple debugging and profiling of (distributed) Rust applications using the tracing crate. Record trace files and view them within within seconds without complex setup or configuration.

Trace Deck Screenshot

Setup

  1. Add the following dependencies to your application:
cargo add tracing tracing-subscriber tracing-tape-recorder
  1. Add the following code to your application:
use tracing::trace_span;
use tracing_subscriber::{fmt, layer::SubscriberExt, Registry};
use tracing_tape_recorder::TapeRecorder;

let subscriber = Registry::default().with(TapeRecorder::default());
let guard = tracing::subscriber::set_default(subscriber);

// ...

drop(guard);

Running your application will now generate a {name}-{timestamp}.tape file in the current working directory.

Note: it is preferred to use set_default instead of set_global_default to ensure the subsriber is dropped when the guard goes out of scope. See #7 for more information.

Viewing Tape Files

You can use the trace-deck application to view the recorded tape files either by running trace-deck filename.tape or by dragging the files into the window. You can load multiple files simultaneously which can be useful for analyzing workflows across multiple applications (e.g., client-server interactions). Have a look at the getting started guide.

Crates

  • tracing-tape: defines the format of the tape files.
  • tracing-tape-recorder: records trace events to tape files.
  • tracing-tape-parser: parses recorded tape files.
  • trace-deck: GUI application for viewing tape files.

Known Issues

  • Currently there is no way, to configure the tape recorder (#6, #8).
  • Recent data is lost when the tape recorder is not properly dropped (#7).
  • Loading large tape files can be slow (#9).
  • Recording tape files will occasionally cause lag spikes (#10).
Commit count: 44

cargo fmt