A high-performance and ergonomic timeline tracing library for Rust. Builtin supports Jaeger and Datadog.
[dependencies]
minitrace = "0.4"
minitrace-jaeger = "0.4"
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.
docker run --rm -d -p6831:6831/udp -p16686:16686 --name jaeger jaegertracing/all-in-one:latest
cargo run --example synchronous
# or
cargo run --example asynchronous
Open http://localhost:16686 to see the results.
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]