Technical Documentation: MaterializeInc/tracing
โน๏ธ Provenance: Multi-Tier Ingestion ยท CodeWiki Reference
Overview (`README.md`)
Website |
Chat | Documentation (master branch)
The master branch is the pre-release, development version of `tracing`. Please see the [v0.1.x](https://github.com/tokio-rs/tracing/tree/v0.1.x) branch for the versions of `tracing` released to crates.io.
Overview
tracing is a framework for instrumenting Rust programs to collect
structured, event-based diagnostic information. tracing is maintained by the
Tokio project, but does not require the tokio runtime to be used.
Usage
In Applications
In order to record trace events, executables have to use a collector
implementation compatible with tracing. A collector implements a way of
collecting trace data, such as by logging it to standard output.tracing-subscriber's fmt module provides
a collector for logging traces with reasonable defaults. Additionally,tracing-subscriber is able to consume messages emitted by log-instrumented
libraries and modules.
To use tracing-subscriber, add the following to your Cargo.toml:
[dependencies]
tracing = "0.1"
tracing-subscriber = "0.3"Then create and install a collector, for example using init():
use tracing::info;
use tracing_subscriber;
fn main() {
// install global collector configured based on RUST_LOG env var.
tracing_subscriber::fmt::init();
let number_of_yaks = 3;
// this creates a new event, outside of any spans.
info!(number_of_yaks, "preparing to shave yaks");
let number_shaved = yak_shave::shave_all(number_of_yaks);
info!(
all_yaks_shaved = number_shaved == number_of_yaks,
"yak shaving completed."
);
}Using init() calls set_global_default() so this collector will be used
as the default in all threads for the remainder of the duration of the
program, similar to how loggers work in the log crate.
For more control, a collector can be built in stages and not set globally,
but instead used to locally override the default collector. For example:
use tracing::{info, Level};
use tracing_subscriber;
fn main() {
let collector = tracing_subscriber::fmt()
// filter spans/events with level TRACE or higher.
.with_max_level(Level::TRACE)
// build but do not install the subscriber.
.finish();
tracing::collect::with_default(collector, || {
info!("This will be logged to stdout");
});
info!("This will _not_ be logged to stdout");
}Any trace events generated outside the context of a collector will not be collected.
This approach allows trace data to be collected by multiple collectors
within different contexts in the program. Note that the override only applies to the
currently executing thread; other threads will not see the change from with_default.
Once a collector has been set, instrumentation points may be added to the
executable using the tracing crate's macros.
In Libraries
Libraries should only rely on the tracing crate and use the provided macros
and types to collect whatever information might be useful to downstream consumers.
/* Detailed source-code truncated for AI context efficiency. */[dependencies]
tracing = "0.1"Note: Libraries should NOT install a collector by using a method that callsset_global_default(), as this will cause conflicts when executables try to
set the default later.
In Asynchronous Code
To trace async fns, the preferred method is using the #[instrument] attribute:
use tracing::{info, instrument};
use tokio::{io::AsyncWriteExt, net::TcpStream};
use std::io;
#[instrument]
async fn write(stream: &mut TcpStream) -> io::Result<usize> {
let result = stream.write(b"hello world\n").await;
info!("wrote to stream; success={:?}", result.is_ok());
result
}Special handling is needed for the general case of code usingstd::future::Future or blocks with async/await, as the
following example will not work:
async {
let _s = span.enter();
// ...
}The span guard _s will not exit until the future generated by the async block is complete.
Since futures and spans can be entered and exited multiple times without them completing,
the span remains entered for as long as the future exists, rather than being entered only when
it is polled, leading to very confusing and incorrect output.
For more details, see the documentation on closing spans.
This problem can be solved using the Future::instrument combinator:
use tracing::Instrument;
let my_future = async {
// ...
};
my_future
.instrument(tracing::info_span!("my_future"))
.awaitFuture::instrument attaches a span to the future, ensuring that the span's lifetime
is as long as the future's.
Under the hood, the #[instrument] macro performs the same explicit span
attachment that Future::instrument does.
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
Getting Help
First, see if the answer to your question can be found in the API documentation.
If the answer is not there, there is an active community in
the Tracing Discord channel. We would be happy to try to answer your
question. Last, if that doesn't work, try opening an issue with the question.
Contributing
:balloon: Thanks for your help improving the project! We are so happy to have
you! We have a contributing guide to help you get involved in the Tracing
project.
Project layout
The tracing crate contains the primary instrumentation API, used for
instrumenting libraries and applications to emit trace data. The tracing-core
crate contains the core API primitives on which the rest of tracing is
instrumented. Authors of trace subscribers may depend on tracing-core, which
guarantees a higher level of stability.
Additionally, this repository contains several compatibility and utility
libraries built on top of tracing. Some of these crates are in a pre-release
state, and are less stable than the tracing and tracing-core crates.
The crates included as part of Tracing are:
tracing-futures: Utilities for instrumentingfutures.
(crates.io|docs)tracing-macros: Experimental macros for emitting trace events (unstable).tracing-attributes: Procedural macro attributes for automatically
instrumenting functions. (crates.io|docs)tracing-log: Compatibility with thelogcrate (unstable).tracing-serde: A compatibility layer for serializing trace data with
serde(unstable).tracing-subscriber: Collector implementations, and utilities for
implementing and composingCollectors.
(crates.io|docs)tracing-tower: Compatibility with thetowerecosystem (unstable).tracing-appender: Utilities for outputting tracing data, including a file appender
and non-blocking writer. (crates.io|docs)tracing-error: ProvidesSpanTrace, a type for instrumenting errors with
tracing spanstracing-flame; Provides a layer for generating flame graphs based on
tracing span entry / exit events.tracing-journald: Provides a layer for recording events to the
Linuxjournaldservice, preserving structured data.
Related Crates
In addition to this repository, here are also several third-party crates which
are not maintained by the tokio project. These include:
tracing-timingimplements inter-event timing metrics on top oftracing.
It provides a subscriber that records the time elapsed between pairs oftracingevents and generates histograms.tracing-honeycombProvides a layer that reports traces spanning multiple machines to honeycomb.io. Backed bytracing-distributed.tracing-distributedProvides a generic implementation of a layer that reports traces spanning multiple machines to some backend.tracing-actix-webprovidestracingintegration for theactix-webweb framework.tracing-actixprovidestracingintegration for theactixactor
framework.axum-insightsprovidestracingintegration and Application insights export for theaxumweb framework.tracing-gelfimplements a subscriber for exporting traces in Greylog
GELF format.tracing-cozprovides integration with the coz causal profiler
(Linux-only).tracing-bunyan-formatterprovides a layer implementation that reports events and spans in bunyan format, enriched with timing information.tide-tracingprovides a tide middleware to trace all incoming requests and responses.color-spantraceprovides a formatter for rendering span traces in the
style ofcolor-backtracecolor-eyreprovides customized panic and eyre report handlers foreyre::Reportfor capturing span traces and backtraces with new errors and
pretty printing them.spandocprovides a proc macro for constructing spans from doc comments
inside of functions.tracing-wasmprovides aCollector/Subscriberimplementation that reports
events and spans via browserconsole.logand User Timing API (window.performance).tracing-webprovides a layer implementation of level-aware logging of events
to web browsers'console.*and span events to the User Timing API (window.performance).test-logtakes care of initializingtracingfor tests, based on
environment variables with anenv_loggercompatible syntax.tracing-unwrapprovides convenience methods to report failed unwraps onResultorOptiontypes to aCollector.diesel-tracingprovides integration withdieseldatabase connections.tracing-tracyprovides a way to collect Tracy profiles in instrumented
applications.tracing-elastic-apmprovides a layer for reporting traces to Elastic APM.tracing-etwprovides a layer for emitting Windows ETW events.sentry-tracingprovides a layer for reporting events and traces to Sentry.tracing-forestprovides a subscriber that preserves contextual coherence by
grouping together logs from the same spans during writing.tracing-lokiprovides a layer for shipping logs to Grafana Loki.tracing-logfmtprovides a layer that formats events and spans into the logfmt format.tracing-chromeprovides a layer that exports trace data that can be viewed inchrome://tracing.reqwest-tracingprovides a middleware to tracereqwestHTTP requests.tracing-cloudwatchprovides a layer that sends events to AWS CloudWatch Logs.clippy-tracingprovides a tool to add, remove and check fortracing::instrument.
(if you're the maintainer of a tracing ecosystem crate not in this list,
please let us know!)
Note: that some of the ecosystem crates are currently unreleased and
undergoing active development. They may be less stable than tracing andtracing-core.
External Resources
This is a list of links to blog posts, conference talks, and tutorials about
Tracing.
Blog Posts
- Diagnostics with Tracing on the Tokio blog, August 2019
- Production-Grade Logging in Rust Applications, November 2020
- Custom Logging in Rust using
tracingandtracing-subscriber, part 1 and part 2, October 2021 - Instrumenting Axum projects, August 2023
Talks
- Bay Area Rust Meetup talk and Q&A, March 2019
- RustConf 2019 talk and slides, August 2019
- Are we observable yet? @ RustyDays talk and slides, August 2020
- Crabs with instruments!, September 2021
Help us expand this list! If you've written or spoken about Tracing, or
know of resources that aren't listed, please open a pull request adding them.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tracing by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`examples/README.md`)
Tracing Examples
This directory contains a collection of examples that demonstrate the use of thetracing ecosystem:
- tracing:
counters: Implements a very simple metrics system to demonstrate how
collectors can consume field values as typed data.sloggish: A demoCollectimplementation that mimics the output ofslog-term'sCompactformatter.
- tracing-attributes:
attrs-basic: A simple example of the#[instrument]attribute.attrs-literal-field-names: Demonstrates using literal field names rather
than rust tokens..attrs-args: An example implementing a simple recursive calculation of
Fibonacci numbers, to demonstrate how the#[instrument]attribute can
record function arguments.
- tracing-subscriber:
fmt: Demonstrates the use of thefmtmodule intracing-subscriber,
which provides a collector implementation that logs traces to the console.fmt-stderr: Demonstrates overriding the output stream used by thefmt
collector.fmt-custom-field: Demonstrates overriding how thefmtcollector formats
fields on spans and events.fmt-custom-event: Demonstrates overriding how thefmtcollector formats
events.fmt-multiple-writers.rs: demonstrates howfmt::Subcribercan write to multiple
destinations (in this instance, stdout and a file) simultaneously.fmt-source-locations.rs: demonstrates displaying source code locations
withfmt::Subscriber.subscriber-filter: Demonstrates thetracing-subscriber::filtermodule,
which provides a subscriber which adds configurable filtering to a collector
implementation.tower-load: Demonstrates how dynamically reloadable filters can be used to
debug a server under load in production.journald: Demonstrates how to usefmtandjournaldsubscribers to output to
both the terminal and the system journal.toggle-subscribers: Demonstrates how subscribers can be wrapped with anOptionallowing
them to be dynamically toggled.
- tracing-futures:
spawny-thing: Demonstrates the use of the#[instrument]attribute macro
asynchronous functions.tokio-spawny-thing.rs: Similar tospawny-thingy, but with the additional
demonstration instrumenting concurrent tasks created withtokio::spawn.futures-proxy-server: Demonstrates the use oftracing-futuresby
implementing a simple proxy server, based on this example
fromtokio.async_fn: Demonstrates how asynchronous functions can be
instrumented.echo: Demonstrates atracing-instrumented variant of Tokio'sechoexample.
- tracing-flame:
infero-flame: Demonstrates the use oftracing-flameto generate a flamegraph
from spans.
- tracing-tower:
tower-client: Demonstrates the use oftracing-towerto instrument a
simpletowerHTTP/1.1 client.tower-server: Demonstrates the use oftracing-towerto instrument a
simpletowerHTTP/1.1 server.
- tracing-serde:
serde-yak-shave: Demonstrates the use oftracing-serdeby implementing a
collector that emits trace output as JSON.
- tracing-log:
hyper-echo: Demonstrates howtracing-logcan be used to record
unstructured logs from dependencies astracingevents, by instrumenting
this example fromhyper, and usingtracing-logto record logs
emitted byhyper.
Overview (`tracing-appender/README.md`)
tracing-appender
Writers for logging events and spans
Overview
tracing is a framework for instrumenting Rust programs to
collect structured, event-based diagnostic information. tracing-appender
allows events and spans to be recorded in a non-blocking manner through a
dedicated logging thread. It also provides a RollingFileAppender
that can be used with or without the non-blocking writer.
Compiler support: requires rustc 1.53+
Usage
Add the following to your Cargo.toml:
tracing-appender = "0.2"This crate can be used in a few ways to record spans/events:
- Using a
RollingFileAppenderto write to a log file.
This is a blocking operation. - Using any type implementing
std::io::Writein a
non-blocking fashion. - Using
NonBlockingandRollingFileAppender
together to write to log files in a non-blocking fashion.
Rolling File Appender
fn main(){
let file_appender = tracing_appender::rolling::hourly("/some/directory", "prefix.log");
}This creates an hourly rotating file appender that writes to/some/directory/prefix.log.YYYY-MM-DD-HH. [Rotation::DAILY] and
[Rotation::NEVER] are the other available options.
The file appender implements std::io::Write. To be used withtracing_subscriber::FmtSubscriber, it must be combined
with a MakeWriter implementation to be able to record
tracing spans/event.
The rolling module's documentation provides more detail on how to use
this file appender.
Non-Blocking Writer
The example below demonstrates the construction of a non_blocking writer
with an implementation of std::io::Writer.
use std::io::Error;
struct TestWriter;
impl std::io::Write for TestWriter {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
let buf_len = buf.len();
println!("{:?}", buf);
Ok(buf_len)
}
fn flush(&mut self) -> std::io::Result<()> {
Ok(())
}
}
fn main() {
let (non_blocking, _guard) = tracing_appender::non_blocking(TestWriter);
tracing_subscriber::fmt().with_writer(non_blocking).init();
}Note: _guard is a WorkerGuard which is returned bytracing_appender::non_blocking to ensure buffered logs are flushed to
their output in the case of abrupt terminations of a process. SeeWorkerGuard module for more details.
The example below demonstrates the construction of atracing_appender::non_blocking writer constructed with
a std::io::Write:
fn main() {
let (non_blocking, _guard) = tracing_appender::non_blocking(std::io::stdout());
tracing_subscriber::fmt()
.with_writer(non_blocking)
.init();
}The non_blocking module's documentation provides more detail on how to
use non_blocking.
Non-Blocking Rolling File Appender
fn main() {
let file_appender = tracing_appender::rolling::hourly("/some/directory", "prefix.log");
let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender);
tracing_subscriber::fmt()
.with_writer(non_blocking)
.init();
}Supported Rust Versions
tracing-appender is built against the latest stable release. The minimum supported
version is 1.53. The current tracing-appender version is not guaranteed to build on
Rust versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current
stable compiler version is 1.69, the minimum supported version will not be
increased past 1.66, three minor versions prior. Increasing the minimum
supported compiler version is not considered a semver breaking change as
long as doing so complies with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tokio by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-attributes/README.md`)
tracing-attributes
Macro attributes for application-level tracing.
Overview
tracing is a framework for instrumenting Rust programs to collect
structured, event-based diagnostic information. This crate provides the#[instrument] attribute for automatically instrumenting functions usingtracing.
Note that this macro is also re-exported by the main tracing crate.
Compiler support: requires rustc 1.63+
Usage
First, add this to your Cargo.toml:
[dependencies]
tracing-attributes = "0.1.11"This crate provides the #[instrument] attribute for instrumenting a function
with a tracing span. For example:
use tracing_attributes::instrument;
#[instrument]
pub fn my_function(my_arg: usize) {
// ...
}Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tokio by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-core/README.md`)
tracing-core
Core primitives for application-level tracing.
Overview
tracing is a framework for instrumenting Rust programs to collect
structured, event-based diagnostic information. This crate defines the core
primitives of tracing.
The crate provides:
span::Ididentifies a span within the execution of a program.Eventrepresents a single event within a trace.Collect, the trait implemented to collect trace data.MetadataandCallsiteprovide information describing spans and
events.Field,FieldSet,Value, andValueSetrepresent the
structured data attached to spans and events.Dispatchallows spans and events to be dispatched toSubscribers.
In addition, it defines the global callsite registry and per-thread current
dispatcher which other components of the tracing system rely on.
Compiler support: requires rustc 1.63+
Usage
Application authors will typically not use this crate directly. Instead, they
will use the tracing crate, which provides a much more fully-featured
API. However, this crate's API will change very infrequently, so it may be used
when dependencies must be very stable.
Subscriber implementations may depend on tracing-core rather than tracing,
as the additional APIs provided by tracing are primarily useful for
instrumenting libraries and applications, and are generally not necessary forSubscriber implementations.
Crate Feature Flags
The following crate feature flags are available:
std: Depend on the Rust standard library (enabled by default).no_stdusers may disable this feature withdefault-features = false:toml[dependencies] tracing-core = { version = "0.1.17", default-features = false }Note:
tracing-core'sno_stdsupport requiresliballoc.
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.69, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tokio by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-error/README.md`)
tracing-error
Utilities for enriching error handling with tracing diagnostic
information.
Documentation (release) | Documentation (master) | Chat
Overview
tracing is a framework for instrumenting Rust programs to collect
scoped, structured, and async-aware diagnostics. This crate provides
integrations between tracing instrumentation and Rust error handling. It
enables enriching error types with diagnostic information from tracing
span contexts, formatting those contexts when errors are displayed, and
automatically generate tracing events when errors occur.
The crate provides the following:
SpanTrace, a captured trace of the currenttracingspan contextErrorSubscriber, a subscriber layer which enables capturingSpanTraces
Note: This crate is currently experimental.
Compiler support: requires rustc 1.63+
Usage
tracing-error provides the SpanTrace type, which captures the currenttracing span context when it is constructed and allows it to be displayed
at a later time.
For example:
use std::{fmt, error::Error};
use tracing_error::SpanTrace;
#[derive(Debug)]
pub struct MyError {
context: SpanTrace,
// ...
}
impl fmt::Display for MyError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// ... format other parts of the error ...
self.context.fmt(f)?;
// ... format other error context information, cause chain, etc ...
# Ok(())
}
}
impl Error for MyError {}
impl MyError {
pub fn new() -> Self {
Self {
context: SpanTrace::capture(),
// ... other error information ...
}
}
}This crate also provides TracedError, for attaching a SpanTrace to an
existing error. The easiest way to wrap errors in TracedError is to either
use the InstrumentResult and InstrumentError traits or the From/Into
traits.
use tracing_error::prelude::*;
std::fs::read_to_string("myfile.txt").in_current_span()?;Once an error has been wrapped with with a TracedError, the SpanTrace
can be extracted one of three ways: either via TracedError'sDisplay/Debug implementations, or via the ExtractSpanTrace trait.
For example, here is how one might print the errors but specialize the
printing when the error is a placeholder for a wrapping SpanTrace:
use std::error::Error;
use tracing_error::ExtractSpanTrace as _;
fn print_extracted_spantraces(error: &(dyn Error + 'static)) {
let mut error = Some(error);
let mut ind = 0;
eprintln!("Error:");
while let Some(err) = error {
if let Some(spantrace) = err.span_trace() {
eprintln!("found a spantrace:\n{}", spantrace);
} else {
eprintln!("{:>4}: {}", ind, err);
}
error = err.source();
ind += 1;
}
}Whereas here, we can still display the content of the SpanTraces without
any special casing by simply printing all errors in our error chain.
use std::error::Error;
fn print_naive_spantraces(error: &(dyn Error + 'static)) {
let mut error = Some(error);
let mut ind = 0;
eprintln!("Error:");
while let Some(err) = error {
eprintln!("{:>4}: {}", ind, err);
error = err.source();
ind += 1;
}
}Applications that wish to use tracing-error-enabled errors should
construct an ErrorSubscriber and add it to their Subscriber in order to
enable capturing SpanTraces. For example:
use tracing_error::ErrorSubscriber;
use tracing_subscriber::prelude::*;
fn main() {
let subscriber = tracing_subscriber::Registry::default()
// any number of other subscriber layers may be added before or
// after the `ErrorSubscriber`...
.with(ErrorSubscriber::default());
// set the subscriber as the default for the application
tracing::subscriber::set_global_default(subscriber);
}Feature Flags
traced-error- Enables theTracedErrortype and related traitsInstrumentResultandInstrumentErrorextension traits, which
provide anin_current_span()method for bundling errors with a
SpanTrace.ExtractSpanTraceextension trait, for extractingSpanTraces from
behinddyn Errortrait objects.
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
Related Crates
In addition to this repository, here are also several third-party crates which
are not maintained by the tokio project. These include:
color-spantraceprovides a formatter for rendering SpanTrace in the style
ofcolor-backtracecolor-eyreprovides a customized version ofeyre::Reportfor capturing
span traces and backtraces with new errors and pretty printing them in error
reports.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tracing by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-flame/README.md`)
tracing-flame
A tracing Layer for generating a folded stack trace for generating flamegraphs
and flamecharts with inferno
Overview
tracing is a framework for instrumenting Rust programs to collect
scoped, structured, and async-aware diagnostics. tracing-flame provides helpers
for consuming tracing instrumentation that can later be visualized as a
flamegraph/flamechart. Flamegraphs/flamecharts are useful for identifying performance
bottlenecks in an application. For more details, see Brendan Gregg's post
on flamegraphs.
Compiler support: requires rustc 1.63+
Usage
This crate is meant to be used in a two step process:
- Capture textual representation of the spans that are entered and exited
withFlameLayer. - Feed the textual representation into
inferno-flamegraphto generate the
flamegraph or flamechart.
Note: when using a buffered writer as the writer for a FlameLayer, it is necessary to
ensure that the buffer has been flushed before the data is passed intoinferno-flamegraph. For more details on how to flush the internal writer
of the FlameLayer, see the docs for FlushGuard.
Layer Setup
use tracing_flame::FlameLayer;
use tracing_subscriber::{prelude::*, fmt};
fn setup_global_subscriber() -> impl Drop {
let fmt_layer = fmt::Layer::default();
let (flame_layer, _guard) = FlameLayer::with_file("./tracing.folded").unwrap();
tracing_subscriber::registry()
.with(fmt_layer)
.with(flame_layer)
.init();
_guard
}
// your code here ..As an alternative, you can provide any type that implements std::io::Write toFlameLayer::new.
Generating the Image
To convert the textual representation of a flamegraph to a visual one, first install inferno:
cargo install infernoThen, pass the file created by FlameLayer into inferno-flamegraph:
# flamegraph
cat tracing.folded | inferno-flamegraph > tracing-flamegraph.svg
# flamechart
cat tracing.folded | inferno-flamegraph --flamechart > tracing-flamechart.svgDifferences between `flamegraph`s and `flamechart`s
By default, inferno-flamegraph creates flamegraphs. Flamegraphs operate by
that collapsing identical stack frames and sorting them on the frame's names.
This behavior is great for multithreaded programs and long-running programs
where the same frames occur many times, for short durations, because it reduces
noise in the graph and gives the reader a better idea of the
overall time spent in each part of the application.
However, it is sometimes desirable to preserve the exact ordering of events
as they were emitted by tracing-flame, so that it is clear when each
span is entered relative to others and get an accurate visual trace of
the execution of your program. This representation is best created with a
flamechart, which does not sort or collapse identical stack frames.
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tracing by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-futures/README.md`)
tracing-futures
Utilities for instrumenting futures-based code with tracing.
Overview
tracing is a framework for instrumenting Rust programs to collect
structured, event-based diagnostic information. This crate provides utilities
for using tracing to instrument asynchronous code written using futures and
async/await.
The crate provides the following traits:
Instrumentallows atracingspan to be attached to a future, sink,
stream, or executor.WithSubscriberallows atracingSubscriberto be attached to a
future, sink, stream, or executor.
Compiler support: requires rustc 1.63+
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tracing by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-journald/README.md`)
tracing-journald
Support for logging tracing events natively to journald,
preserving structured information.
Overview
tracing is a framework for instrumenting Rust programs to collect
scoped, structured, and async-aware diagnostics. tracing-journald provides atracing-subscriber::Layer implementation for logging tracing spans
and events to systemd-journald, on Linux distributions that usesystemd.
Compiler support: requires rustc 1.63+
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tracing by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-log/README.md`)
tracing-log
log compatibility for tracing.
Documentation | Chat (discord)
Overview
tracing is a framework for instrumenting Rust programs with context-aware,
structured, event-based diagnostic information. This crate provides
compatibility layers for using tracing alongside the logging facade provided
by the log crate.
This crate provides:
AsTraceandAsLogtraits for converting betweentracingandlogtypes.LogTracer, alog::Logimplementation that consumeslog::Records
and outputs them astracing::Events.- An
env_loggermodule, with helpers for using the [env_loggercrate]
withtracing(optional, enabled by theenv_loggerfeature).
Compiler support: requires rustc 1.63+
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tracing by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-mock/README.md`)
tracing-mock
Utilities for testing tracing and crates that uses it.
Overview
tracing is a framework for instrumenting Rust programs to collect
structured, event-based diagnostic information. tracing-mock provides
tools for making assertions about what tracing diagnostics are emitted
by code under test.
Compiler support: requires rustc 1.63+
Usage
tracing-mock crate provides a mockCollector
that allows asserting on the order and contents of
spans and
events.
As tracing-mock isn't available on crates.io
yet, you must import it via git. When using tracing-mock with thetracing 0.1 ecosystem, it is important that you also override the
source of any tracing crates that are transient dependencies. For
example, the Cargo.toml for your test crate could contain:
[dependencies]
lib-under-test = "1.0" # depends on `tracing`
[dev-dependencies]
tracing-mock = { git = "https://github.com/tokio-rs/tracing", branch = "v0.1.x", version = "0.1" }
tracing = { git = "https://github.com/tokio-rs/tracing", branch = "v0.1.x", version = "0.1" }
[patch.crates-io]
tracing = { git = "https://github.com/tokio-rs/tracing", branch = "v0.1.x" }
tracing-core = { git = "https://github.com/tokio-rs/tracing", branch = "v0.1.x" }Examples
The following examples are for the master branch. For examples that
will work with tracing from [crates.io], please check the
v0.1.x
branch.
Below is an example that checks that an event contains a message:
use tracing::collect::with_default;
use tracing_mock::{collector, expect};
fn yak_shaving() {
tracing::info!("preparing to shave yaks");
}
let (collector, handle) = collector::mock()
.event(expect::event().with_fields(expect::message("preparing to shave yaks")))
.only()
.run_with_handle();
with_default(collector, || {
yak_shaving();
});
handle.assert_finished();Below is a slightly more complex example. tracing-mock asserts that, in order:
- a span is created with a single field/value pair
- the span is entered
- an event is created with the field
number_of_yaks, a corresponding
value of 3, and the message "preparing to shave yaks", and nothing else - an event is created with the field
all_yaks_shaved, a corresponding value
oftrue, and the message "yak shaving completed" - the span is exited
- no further traces are received
use tracing::collect::with_default;
use tracing_mock::{collector, expect};
#[tracing::instrument]
fn yak_shaving(number_of_yaks: u32) {
tracing::info!(number_of_yaks, "preparing to shave yaks");
let number_shaved = number_of_yaks; // shave_all
tracing::info!(
all_yaks_shaved = number_shaved == number_of_yaks,
"yak shaving completed."
);
}
let yak_count: u32 = 3;
let span = expect::span().named("yak_shaving");
let (collector, handle) = collector::mock()
.new_span(
span.clone()
.with_fields(expect::field("number_of_yaks").with_value(&yak_count).only()),
)
.enter(span.clone())
.event(
expect::event().with_fields(
expect::field("number_of_yaks")
.with_value(&yak_count)
.and(expect::message("preparing to shave yaks"))
.only(),
),
)
.event(
expect::event().with_fields(
expect::field("all_yaks_shaved")
.with_value(&true)
.and(expect::message("yak shaving completed."))
.only(),
),
)
.exit(span.clone())
.only()
.run_with_handle();
with_default(collector, || {
yak_shaving(yak_count);
});
handle.assert_finished();Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tracing by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-serde/README.md`)
tracing-serde
An adapter for serializing tracing types using serde.
Overview
tracing is a framework for instrumenting Rust programs to collect
scoped, structured, and async-aware diagnostics.tracing-serde enables
serializing tracing types using serde.
Traditional logging is based on human-readable text messages.tracing gives us machine-readable structured diagnostic
information. This lets us interact with diagnostic data
programmatically. With tracing-serde, you can implement aSubscriber to serialize your tracing types and make use of the
existing ecosystem of serde serializers to talk with distributed
tracing systems.
Serializing diagnostic information allows us to do more with our logged
values. For instance, when working with logging data in JSON gives us
pretty-print when we're debugging in development and you can emit JSON
and tracing data to monitor your services in production.
The tracing crate provides the APIs necessary for instrumenting
libraries and applications to emit trace data.
Compiler support: requires rustc 1.63+
Usage
First, add this to your Cargo.toml:
[dependencies]
tracing = "0.1"
tracing-serde = "0.1"Next, add this to your crate:
use tracing_serde::AsSerde;Please read the tracing documentation
for more information on how to create trace data.
This crate provides the as_serde function, via the AsSerde trait,
which enables serializing the Attributes, Event, Id, Metadata,
and Record tracing values.
For the full example, please see the examples folder.
Implement a Subscriber to format the serialization of tracing
types how you'd like.
pub struct JsonSubscriber {
next_id: AtomicUsize, // you need to assign span IDs, so you need a counter
}
impl Subscriber for JsonSubscriber {
fn new_span(&self, attrs: &Attributes) -> Id {
let id = self.next_id.fetch_add(1, Ordering::Relaxed);
let id = Id::from_u64(id as u64);
let json = json!({
"new_span": {
"attributes": attrs.as_serde(),
"id": id.as_serde(),
}});
println!("{}", json);
id
}
// ...
}After you implement your Subscriber, you can use your tracing
subscriber (JsonSubscriber in the above example) to record serialized
trace data.
Crate Feature Flags
The following crate feature flags are available:
std: Depend on the Rust standard library (enabled by default).no_stdusers may disable this feature withdefault-features = false:toml[dependencies] tracing-serde = { version = "0.2", default-features = false }Note:
tracing-serde'sno_stdsupport requiresliballoc.
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tokio by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-subscriber/README.md`)
tracing-subscriber
Utilities for implementing and composing tracing subscribers.
Compiler support: requires rustc 1.63+
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tracing by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing-test/README.md`)
tracing-test
Utilities for testing tracing and crates that uses it.
Overview
tracing is a framework for instrumenting Rust programs to collect
structured, event-based diagnostic information. tracing-test provides
some reusable tools to aid in testing, but that are only intended for
internal use. For mocks and expectations, see [tracing-mock].
Compiler support: requires rustc 1.56+
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.56. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.45, the minimum supported version will not be increased
past 1.42, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tracing by you, shall be licensed as MIT, without any additional
terms or conditions.
Overview (`tracing/README.md`)
tracing
Application-level tracing for Rust.
Overview
tracing is a framework for instrumenting Rust programs to collect
structured, event-based diagnostic information.
In asynchronous systems like Tokio, interpreting traditional log messages can
often be quite challenging. Since individual tasks are multiplexed on the same
thread, associated events and log lines are intermixed making it difficult to
trace the logic flow. tracing expands upon logging-style diagnostics by
allowing libraries and applications to record structured events with additional
information about temporality and causality โ unlike a log message, a span
in tracing has a beginning and end time, may be entered and exited by the
flow of execution, and may exist within a nested tree of similar spans. In
addition, tracing spans are structured, with the ability to record typed
data as well as textual messages.
The tracing crate provides the APIs necessary for instrumenting libraries
and applications to emit trace data.
Compiler support: requires rustc 1.63+
Usage
(The examples below are borrowed from the log crate's yak-shaving
example, modified to
idiomatic tracing.)
In Applications
In order to record trace events, executables have to use a Subscriber
implementation compatible with tracing. A Subscriber implements a way of
collecting trace data, such as by logging it to standard output. tracing_subscriber'sfmt module provides reasonable defaults.
Additionally, tracing-subscriber is able to consume messages emitted by log-instrumented libraries and modules.
The simplest way to use a subscriber is to call the set_global_default function.
use tracing::{info, Level};
use tracing_subscriber::FmtSubscriber;
fn main() {
// a builder for `FmtSubscriber`.
let subscriber = FmtSubscriber::builder()
// all spans/events with a level higher than TRACE (e.g, debug, info, warn, etc.)
// will be written to stdout.
.with_max_level(Level::TRACE)
// completes the builder.
.finish();
tracing::subscriber::set_global_default(subscriber)
.expect("setting default subscriber failed");
let number_of_yaks = 3;
// this creates a new event, outside of any spans.
info!(number_of_yaks, "preparing to shave yaks");
let number_shaved = yak_shave::shave_all(number_of_yaks);
info!(
all_yaks_shaved = number_shaved == number_of_yaks,
"yak shaving completed."
);
}[dependencies]
tracing = "0.1"
tracing-subscriber = "0.2.0"This subscriber will be used as the default in all threads for the remainder of the duration
of the program, similar to how loggers work in the log crate.
In addition, you can locally override the default subscriber. For example:
use tracing::{info, Level};
use tracing_subscriber::FmtSubscriber;
fn main() {
let subscriber = tracing_subscriber::FmtSubscriber::builder()
// all spans/events with a level higher than TRACE (e.g, debug, info, warn, etc.)
// will be written to stdout.
.with_max_level(Level::TRACE)
// builds the subscriber.
.finish();
tracing::subscriber::with_default(subscriber, || {
info!("This will be logged to stdout");
});
info!("This will _not_ be logged to stdout");
}This approach allows trace data to be collected by multiple subscribers
within different contexts in the program. Note that the override only applies to the
currently executing thread; other threads will not see the change from with_default.
Any trace events generated outside the context of a subscriber will not be collected.
Once a subscriber has been set, instrumentation points may be added to the
executable using the tracing crate's macros.
In Libraries
Libraries should only rely on the tracing crate and use the provided macros
and types to collect whatever information might be useful to downstream consumers.
/* Detailed source-code truncated for AI context efficiency. */[dependencies]
tracing = "0.1"Note: Libraries should NOT call set_global_default(), as this will cause
conflicts when executables try to set the default later.
In Asynchronous Code
If you are instrumenting code that make use ofstd::future::Future
or async/await, avoid using the Span::enter method. The following example
will not work:
async {
let _s = span.enter();
// ...
}The span guard _s will not exit until the future generated by the async block is complete.
Since futures and spans can be entered and exited multiple times without them completing,
the span remains entered for as long as the future exists, rather than being entered only when
it is polled, leading to very confusing and incorrect output.
For more details, see the documentation on closing spans.
There are two ways to instrument asynchronous code. The first is through theFuture::instrument combinator:
use tracing::Instrument;
let my_future = async {
// ...
};
my_future
.instrument(tracing::info_span!("my_future"))
.awaitFuture::instrument attaches a span to the future, ensuring that the span's lifetime
is as long as the future's.
The second, and preferred, option is through the#[instrument]
attribute:
use tracing::{info, instrument};
use tokio::{io::AsyncWriteExt, net::TcpStream};
use std::io;
#[instrument]
async fn write(stream: &mut TcpStream) -> io::Result<usize> {
let result = stream.write(b"hello world\n").await;
info!("wrote to stream; success={:?}", result.is_ok());
result
}Under the hood, the #[instrument] macro performs the same explicit span
attachment that Future::instrument does.
Concepts
This crate provides macros for creating Spans and Events, which represent
periods of time and momentary events within the execution of a program,
respectively.
As a rule of thumb, spans should be used to represent discrete units of work
(e.g., a given request's lifetime in a server) or periods of time spent in a
given context (e.g., time spent interacting with an instance of an external
system, such as a database). In contrast, events should be used to represent
points in time within a span โ a request returned with a given status code,
n new items were taken from a queue, and so on.
Spans are constructed using the span! macro, and then entered
to indicate that some code takes place within the context of that Span:
use tracing::{span, Level};
// Construct a new span named "my span".
let mut span = span!(Level::INFO, "my span");
span.in_scope(|| {
// Any trace events in this closure or code called by it will occur within
// the span.
});
// Dropping the span will close it, indicating that it has ended.The #[instrument] attribute macro
can reduce some of this boilerplate:
use tracing::{instrument};
#[instrument]
pub fn my_function(my_arg: usize) {
// This event will be recorded inside a span named `my_function` with the
// field `my_arg`.
tracing::info!("inside my_function!");
// ...
}The Event type represent an event that occurs instantaneously, and is
essentially a Span that cannot be entered. They are created using the event!
macro:
use tracing::{event, Level};
event!(Level::INFO, "something has happened!");Users of the log crate should note that tracing exposes a set of macros for
creating Events (trace!, debug!, info!, warn!, and error!) which may
be invoked with the same syntax as the similarly-named macros from the log
crate. Often, the process of converting a project to use tracing can begin
with a simple drop-in replacement.
Ecosystem
Related Crates
In addition to tracing and tracing-core, the tokio-rs/tracing repository
contains several additional crates designed to be used with the tracing ecosystem.
This includes a collection of Subscriber implementations, as well as utility
and adapter crates to assist in writing Subscribers and instrumenting
applications.
In particular, the following crates are likely to be of interest:
tracing-futuresprovides a compatibility layer with thefutures
crate, allowing spans to be attached toFutures,Streams, andExecutors.tracing-subscriberprovidesSubscriberimplementations and
utilities for working withSubscribers. This includes aFmtSubscriberFmtSubscriberfor logging formatted trace data to stdout, with similar
filtering and formatting to theenv_loggercrate.tracing-logprovides a compatibility layer with thelogcrate,
allowing log messages to be recorded astracingEvents within the
trace tree. This is useful when a project usingtracinghave
dependencies which uselog. Note that if you're usingtracing-subscriber'sFmtSubscriber, you don't need to depend ontracing-logdirectly.tracing-opentelemetry: Provides a layer that connects spans from multiple
systems into a trace and emits them to OpenTelemetry-compatible distributed
tracing systems for processing and visualization.
Additionally, there are also several third-party crates which are not
maintained by the tokio project. These include:
tracing-timingimplements inter-event timing metrics on top oftracing.
It provides a subscriber that records the time elapsed between pairs oftracingevents and generates histograms.tracing-honeycombProvides a layer that reports traces spanning multiple machines to honeycomb.io. Backed bytracing-distributed.tracing-distributedProvides a generic implementation of a layer that reports traces spanning multiple machines to some backend.tracing-actixprovidestracingintegration for theactixactor
framework.axum-insightsprovidestracingintegration and Application insights export for theaxumweb framework.tracing-gelfimplements a subscriber for exporting traces in Greylog
GELF format.tracing-cozprovides integration with the coz causal profiler
(Linux-only).test-logtakes care of initializingtracingfor tests, based on
environment variables with anenv_loggercompatible syntax.tracing-unwrapprovides convenience methods to report failed unwraps onResultorOptiontypes to aSubscriber.diesel-tracingprovides integration withdieseldatabase connections.tracing-tracyprovides a way to collect Tracy profiles in instrumented
applications.tracing-elastic-apmprovides a layer for reporting traces to Elastic APM.tracing-etwprovides a layer for emitting Windows ETW events.tracing-fluent-assertionsprovides a fluent assertions-style testing
framework for validating the behavior oftracingspans.sentry-tracingprovides a layer for reporting events and traces to Sentry.tracing-lokiprovides a layer for shipping logs to Grafana Loki.tracing-logfmtprovides a layer that formats events and spans into the logfmt format.
If you're the maintainer of a tracing ecosystem crate not listed above,
please let us know! We'd love to add your project to the list!
Note: that some of the ecosystem crates are currently unreleased and
undergoing active development. They may be less stable than tracing andtracing-core.
Supported Rust Versions
Tracing is built against the latest stable release. The minimum supported
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.
Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tokio by you, shall be licensed as MIT, without any additional
terms or conditions.
--- METRICS ---
- Files Extracted: 15
- Estimated Token Budget: ~23562 tokens
- Canonical Reference: https://codewiki.google/github.com/MaterializeInc/tracing