/minitrace-rust

Extremely fast tracing library for Rust

Primary LanguageRustApache License 2.0Apache-2.0

minitrace: Extremely fast tracing library for Rust

Crates.io Documentation CI Status Coverage License


Minitrace is a Rust tracing library 10~100x faster than others:

benchmark

Features:

Resources

Benchmarks

By different architectures:

Benchmark result by architecture

x86-64 (Intel Broadwell) x86-64 (Intel Skylake) x86-64 (AMD Zen) ARM (AWS Graviton2)
tokio-tracing 124x slower 33x slower 36x slower 29x slower
rustracing 45x slower 10x slower 11x slower 9x slower
minitrace (baseline) 1x (3.4us) 1x (3.2us) 1x (3.8us) 1x (4.2us)

By creating different number of spans:

Benchmark result by number of spans

1 span 10 spans 100 spans 1000 spans
tokio-tracing 19x slower 61x slower 124x slower 151x slower
rustracing 13x slower 26x slower 45x slower 55x slower
minitrace (baseline) 1x (0.4us) 1x (0.8us) 1x (3.4us) 1x (27.8us)

Detailed results are available in etc/benchmark-result.

Projects using minitrace

Feel free to open a PR and add your projects here:

  • TiKV: A distributed transactional key-value database

FAQ

Why is minitrace so fast?

There are some articles posted by the maintainer of minitrace:

Why / What's the difference compared to 'X'?

Most tracing libraries aims to provide more features, while minitrace always prioritize performance. Usually minitrace only provides basic and common tracing features.

Will you support OpenTelemetry feature 'X'?

Minitrace is focused on high performance tracing only. You can open an issue for the missing tracing features you want to have.

Note that we always prioritize performance over features, so that not all tracing feature requests may be accepted.

What's the status of this library?

API Unstable: The API is not stabilized yet, may be changed in the future.

Code base Tested: Minitrace has been tested with high coverage. However, applications utilizing minitrace have not been widely deployed, so that minitrace is currently NOT regarded as battle-tested.