fastrace-tracing
A compatibility layer that connects toiok-tracing with the fastrace tracing library.
Overview
fastrace-tracing allows you to capture spans and events from libraries that use tokio-tracing and forward them to fastrace. This is particularly useful when:
- You're using
fastracein your application but depend on libraries instrumented withtokio-tracing - You want to migrate from
tokio-tracingtofastraceincrementally
Getting Started
Add fastrace-tracing to your project:
[]
= { = "0.7", = ["enable"] }
= "0.1"
= "0.1"
= "0.3"
Set up the compatibility layer:
use ;
use *;
use SubscriberExt;
// Initialize fastrace.
set_reporter;
// Set up tokio-tracing with the fastrace compatibility layer.
let subscriber = default
.with;
set_global_default.unwrap;
// Don't forget to flush before your application exits.
flush;
Examples
Check out the examples directory for more detailed usage examples.
License
This project is licensed under the Apache-2.0 license.