3 unstable releases

0.4.0 Jan 26, 2022
0.3.1 Jan 15, 2022
0.3.0 Jan 14, 2022

#190 in Debugging

Download history 3662/week @ 2022-06-12 3506/week @ 2022-06-19 3308/week @ 2022-06-26 6337/week @ 2022-07-03 6888/week @ 2022-07-10 9806/week @ 2022-07-17 9926/week @ 2022-07-24 9636/week @ 2022-07-31 9240/week @ 2022-08-07 4678/week @ 2022-08-14 554/week @ 2022-08-21 756/week @ 2022-08-28 607/week @ 2022-09-04 783/week @ 2022-09-11 397/week @ 2022-09-18 413/week @ 2022-09-25

2,214 downloads per month
Used in 3 crates

Apache-2.0

375KB
2.5K SLoC

minitrace

Actions Status Coverage Status Documentation Crates.io LICENSE

A high-performance and ergonomic timeline tracing library for Rust. Builtin supports Jaeger and Datadog.

Usage

[dependencies]
minitrace = "0.3"
minitrace-jaeger = "0.3"
use minitrace::prelude::*;
use futures::executor::block_on;

let (root, collector) = Span::root("root");

{
    let _child_span_1 = Span::enter_with_parent("child span 1", &root);
    // some work
}

drop(root);
let records: Vec<SpanRecord> = block_on(collector.collect());

Read the docs for more details.

Examples

Setup Jaeger

docker run --rm -d -p6831:6831/udp -p16686:16686 --name jaeger jaegertracing/all-in-one:latest

Run examples

cargo run --example synchronous
# or
cargo run --example asynchronous

Open http://localhost:16686 to see the results.

Synchronous

Jaeger Synchronous

Asynchronous

Jaeger Asynchronous

Benchmark

Benchmark platform is Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz on CentOS 7.

> cargo criterion

100 spans/Tokio Tracing   time:   [147.64 us 148.80 us 150.25 us]
100 spans/Rustracing      time:   [36.486 us 36.690 us 36.941 us]
100 spans/minitrace       time:   [3.7514 us 3.7564 us 3.7689 us]

Benchmark

Dependencies

~1.8–2.5MB
~46K SLoC