[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5609":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":37,"discoverSource":38},5609,"tracing","tokio-rs\u002Ftracing","tokio-rs","Application level tracing for Rust.","https:\u002F\u002Ftracing.rs",null,"Rust",6733,899,52,627,0,2,20,67,10,85.56,"MIT License",false,"main",true,[27,28,29,30,31,32,33,5],"diagnostics","logging","logging-and-metrics","logging-facade","logging-library","rust","rust-lang","2026-06-12 04:00:25","![Tracing — Structured, application-level diagnostics][splash]\n\n[splash]: https:\u002F\u002Fraw.githubusercontent.com\u002Ftokio-rs\u002Ftracing\u002Fmain\u002Fassets\u002Fsplash.svg\n\n[![Crates.io][crates-badge]][crates-url]\n[![Documentation][docs-badge]][docs-url]\n[![Documentation (v0.2.x)][docs-v0.2.x-badge]][docs-v0.2.x-url]\n[![MIT licensed][mit-badge]][mit-url]\n[![Build Status][actions-badge]][actions-url]\n[![Discord chat][discord-badge]][discord-url]\n\n[crates-badge]: https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Ftracing.svg\n[crates-url]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing\n[docs-badge]: https:\u002F\u002Fdocs.rs\u002Ftracing\u002Fbadge.svg\n[docs-url]: https:\u002F\u002Fdocs.rs\u002Ftracing\n[docs-v0.2.x-badge]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocs-v0.2.x-blue\n[docs-v0.2.x-url]: https:\u002F\u002Ftracing.rs\n[mit-badge]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg\n[mit-url]: LICENSE\n[actions-badge]: https:\u002F\u002Fgithub.com\u002Ftokio-rs\u002Ftracing\u002Fworkflows\u002FCI\u002Fbadge.svg\n[actions-url]: https:\u002F\u002Fgithub.com\u002Ftokio-rs\u002Ftracing\u002Factions?query=workflow%3ACI\n[discord-badge]: https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F500028886025895936?logo=discord&label=discord&logoColor=white\n[discord-url]: https:\u002F\u002Fdiscord.gg\u002FEeF3cQw\n\n[Website](https:\u002F\u002Ftokio.rs) |\n[Chat](https:\u002F\u002Fdiscord.gg\u002FEeF3cQw)\n\n## Overview\n\n`tracing` is a framework for instrumenting Rust programs to collect\nstructured, event-based diagnostic information. `tracing` is maintained by the\nTokio project, but does _not_ require the `tokio` runtime to be used.\n\n### Branch set-up\n\n- [`main`](https:\u002F\u002Fgithub.com\u002Ftokio-rs\u002Ftracing\u002Ftree\u002Fmain) - Default branch, crates.io releases are done from this branch. This was previously the\n  `v0.1.x` branch.\n- [`v0.2.x`](https:\u002F\u002Fgithub.com\u002Ftokio-rs\u002Ftracing\u002Ftree\u002Fv0.2.x) - Branch containing the as-yet unreleased 0.2 version of `tracing-core`, `tracing`, and\n  all the other tracing crates that depend on these versions. This was previously the `master`\n  branch.\n\n## Usage\n\n### In Applications\n\nIn order to record trace events, executables have to use a `Subscriber`\nimplementation compatible with `tracing`. A `Subscriber` implements a way of\ncollecting trace data, such as by logging it to standard output.\n[`tracing-subscriber`][tracing-subscriber-docs]'s [`fmt` module][fmt] provides\na subscriber for logging traces with reasonable defaults. Additionally,\n`tracing-subscriber` is able to consume messages emitted by `log`-instrumented\nlibraries and modules.\n\nTo use `tracing-subscriber`, add the following to your `Cargo.toml`:\n\n```toml\n[dependencies]\ntracing = \"0.1\"\ntracing-subscriber = \"0.3\"\n```\n\nThen create and install a `Subscriber`, for example using [`init()`]:\n\n```rust\nuse tracing::info;\nuse tracing_subscriber;\n\nfn main() {\n    \u002F\u002F install global subscriber configured based on RUST_LOG envvar.\n    tracing_subscriber::fmt::init();\n\n    let number_of_yaks = 3;\n    \u002F\u002F this creates a new event, outside of any spans.\n    info!(number_of_yaks, \"preparing to shave yaks\");\n\n    let number_shaved = yak_shave::shave_all(number_of_yaks);\n    info!(\n        all_yaks_shaved = number_shaved == number_of_yaks,\n        \"yak shaving completed.\"\n    );\n}\n```\n\nUsing `init()` calls [`set_global_default()`] so this subscriber will be used\nas the default in all threads for the remainder of the duration of the\nprogram, similar to how loggers work in the `log` crate.\n\n[tracing-subscriber-docs]: https:\u002F\u002Fdocs.rs\u002Ftracing-subscriber\u002F\n[fmt]: https:\u002F\u002Fdocs.rs\u002Ftracing-subscriber\u002Flatest\u002Ftracing_subscriber\u002Ffmt\u002Findex.html\n[`set_global_default`]: https:\u002F\u002Fdocs.rs\u002Ftracing\u002Flatest\u002Ftracing\u002Fsubscriber\u002Ffn.set_global_default.html\n\n\nFor more control, a subscriber can be built in stages and not set globally,\nbut instead used to locally override the default subscriber. For example:\n\n```rust\nuse tracing::{info, Level};\nuse tracing_subscriber;\n\nfn main() {\n    let subscriber = tracing_subscriber::fmt()\n        \u002F\u002F filter spans\u002Fevents with level TRACE or higher.\n        .with_max_level(Level::TRACE)\n        \u002F\u002F build but do not install the subscriber.\n        .finish();\n\n    tracing::subscriber::with_default(subscriber, || {\n        info!(\"This will be logged to stdout\");\n    });\n    info!(\"This will _not_ be logged to stdout\");\n}\n```\n\nAny trace events generated outside the context of a subscriber will not be collected.\n\nThis approach allows trace data to be collected by multiple subscribers\nwithin different contexts in the program. Note that the override only applies to the\ncurrently executing thread; other threads will not see the change from with_default.\n\nOnce a subscriber has been set, instrumentation points may be added to the\nexecutable using the `tracing` crate's macros.\n\n[`tracing-subscriber`]: https:\u002F\u002Fdocs.rs\u002Ftracing-subscriber\u002F\n[fmt]: https:\u002F\u002Fdocs.rs\u002Ftracing-subscriber\u002Flatest\u002Ftracing_subscriber\u002Ffmt\u002Findex.html\n[`init()`]: https:\u002F\u002Fdocs.rs\u002Ftracing-subscriber\u002Flatest\u002Ftracing_subscriber\u002Ffmt\u002Ffn.init.html\n[`set_global_default()`]: https:\u002F\u002Fdocs.rs\u002Ftracing\u002Flatest\u002Ftracing\u002Fsubscriber\u002Ffn.set_global_default.html\n\n### In Libraries\n\nLibraries should only rely on the `tracing` crate and use the provided macros\nand types to collect whatever information might be useful to downstream consumers.\n\n```rust\nuse std::{error::Error, io};\nuse tracing::{debug, error, info, span, warn, Level};\n\n\u002F\u002F the `#[tracing::instrument]` attribute creates and enters a span\n\u002F\u002F every time the instrumented function is called. The span is named after the\n\u002F\u002F function or method. Parameters passed to the function are recorded as fields.\n#[tracing::instrument]\npub fn shave(yak: usize) -> Result\u003C(), Box\u003Cdyn Error + 'static>> {\n    \u002F\u002F this creates an event at the DEBUG level with two fields:\n    \u002F\u002F - `excitement`, with the key \"excitement\" and the value \"yay!\"\n    \u002F\u002F - `message`, with the key \"message\" and the value \"hello! I'm gonna shave a yak.\"\n    \u002F\u002F\n    \u002F\u002F unlike other fields, `message`'s shorthand initialization is just the string itself.\n    debug!(excitement = \"yay!\", \"hello! I'm gonna shave a yak.\");\n    if yak == 3 {\n        warn!(\"could not locate yak!\");\n        \u002F\u002F note that this is intended to demonstrate `tracing`'s features, not idiomatic\n        \u002F\u002F error handling! in a library or application, you should consider returning\n        \u002F\u002F a dedicated `YakError`. libraries like snafu or thiserror make this easy.\n        return Err(io::Error::new(io::ErrorKind::Other, \"shaving yak failed!\").into());\n    } else {\n        debug!(\"yak shaved successfully\");\n    }\n    Ok(())\n}\n\npub fn shave_all(yaks: usize) -> usize {\n    \u002F\u002F Constructs a new span named \"shaving_yaks\" at the TRACE level,\n    \u002F\u002F and a field whose key is \"yaks\". This is equivalent to writing:\n    \u002F\u002F\n    \u002F\u002F let span = span!(Level::TRACE, \"shaving_yaks\", yaks = yaks);\n    \u002F\u002F\n    \u002F\u002F local variables (`yaks`) can be used as field values\n    \u002F\u002F without an assignment, similar to struct initializers.\n    let span = span!(Level::TRACE, \"shaving_yaks\", yaks);\n    let _enter = span.enter();\n\n    info!(\"shaving yaks\");\n\n    let mut yaks_shaved = 0;\n    for yak in 1..=yaks {\n        let res = shave(yak);\n        debug!(yak, shaved = res.is_ok());\n\n        if let Err(ref error) = res {\n            \u002F\u002F Like spans, events can also use the field initialization shorthand.\n            \u002F\u002F In this instance, `yak` is the field being initialized.\n            error!(yak, error = error.as_ref(), \"failed to shave yak!\");\n        } else {\n            yaks_shaved += 1;\n        }\n        debug!(yaks_shaved);\n    }\n\n    yaks_shaved\n}\n```\n\n```toml\n[dependencies]\ntracing = \"0.1\"\n```\n\nNote: Libraries should *NOT* install a subscriber by using a method that calls\n[`set_global_default()`], as this will cause conflicts when executables try to\nset the default later.\n\n### In Asynchronous Code\n\nTo trace `async fn`s, the preferred method is using the [`#[instrument]`][instrument] attribute:\n\n```rust\nuse tracing::{info, instrument};\nuse tokio::{io::AsyncWriteExt, net::TcpStream};\nuse std::io;\n\n#[instrument]\nasync fn write(stream: &mut TcpStream) -> io::Result\u003Cusize> {\n    let result = stream.write(b\"hello world\\n\").await;\n    info!(\"wrote to stream; success={:?}\", result.is_ok());\n    result\n}\n```\n\nSpecial handling is needed for the general case of code using\n[`std::future::Future`][std-future] or blocks with `async`\u002F`await`, as the\nfollowing example _will not_ work:\n\n```rust\nasync {\n    let _s = span.enter();\n    \u002F\u002F ...\n}\n```\n\nThe span guard `_s` will not exit until the future generated by the `async` block is complete.\nSince futures and spans can be entered and exited _multiple_ times without them completing,\nthe span remains entered for as long as the future exists, rather than being entered only when\nit is polled, leading to very confusing and incorrect output.\nFor more details, see [the documentation on closing spans][closing].\n\nThis problem can be solved using the [`Future::instrument`] combinator:\n\n```rust\nuse tracing::Instrument;\n\nlet my_future = async {\n    \u002F\u002F ...\n};\n\nmy_future\n    .instrument(tracing::info_span!(\"my_future\"))\n    .await\n```\n\n`Future::instrument` attaches a span to the future, ensuring that the span's lifetime\nis as long as the future's.\n\nUnder the hood, the [`#[instrument]`][instrument] macro performs the same explicit span\nattachment that `Future::instrument` does.\n\n[std-future]: https:\u002F\u002Fdoc.rust-lang.org\u002Fstable\u002Fstd\u002Ffuture\u002Ftrait.Future.html\n[closing]: https:\u002F\u002Fdocs.rs\u002Ftracing\u002Flatest\u002Ftracing\u002Fspan\u002Findex.html#closing-spans\n[`Future::instrument`]: https:\u002F\u002Fdocs.rs\u002Ftracing\u002Flatest\u002Ftracing\u002Ftrait.Instrument.html#method.instrument\n[instrument]: https:\u002F\u002Fdocs.rs\u002Ftracing\u002Flatest\u002Ftracing\u002Fattr.instrument.html\n\n## Supported Rust Versions\n\nTracing is built against the latest stable release. The minimum supported\nversion is 1.65. The current Tracing version is not guaranteed to build on Rust\nversions earlier than the minimum supported version.\n\nTracing follows the same compiler support policies as the rest of the Tokio\nproject. The current stable Rust compiler and the three most recent minor\nversions before it will always be supported. For example, if the current stable\ncompiler version is 1.69, the minimum supported version will not be increased\npast 1.66, three minor versions prior. Increasing the minimum supported compiler\nversion is not considered a semver breaking change as long as doing so complies\nwith this policy.\n\n## Getting Help\n\nFirst, see if the answer to your question can be found in the API documentation.\nIf the answer is not there, there is an active community in\nthe [Tracing Discord channel][chat]. We would be happy to try to answer your\nquestion. Last, if that doesn't work, try opening an [issue] with the question.\n\n[chat]: https:\u002F\u002Fdiscord.gg\u002FEeF3cQw\n[issue]: https:\u002F\u002Fgithub.com\u002Ftokio-rs\u002Ftracing\u002Fissues\u002Fnew\n\n## Contributing\n\n:balloon: Thanks for your help improving the project! We are so happy to have\nyou! We have a [contributing guide][guide] to help you get involved in the Tracing\nproject.\n\n[guide]: CONTRIBUTING.md\n\n## Project layout\n\nThe [`tracing`] crate contains the primary _instrumentation_ API, used for\ninstrumenting libraries and applications to emit trace data. The [`tracing-core`]\ncrate contains the _core_ API primitives on which the rest of `tracing` is\ninstrumented. Authors of trace subscribers may depend on `tracing-core`, which\nguarantees a higher level of stability.\n\nAdditionally, this repository contains several compatibility and utility\nlibraries built on top of `tracing`. Some of these crates are in a pre-release\nstate, and are less stable than the `tracing` and `tracing-core` crates.\n\nThe crates included as part of Tracing are:\n\n* [`tracing-futures`]: Utilities for instrumenting `futures`.\n  ([crates.io][fut-crates]|[docs][fut-docs])\n\n* [`tracing-macros`]: Experimental macros for emitting trace events (unstable).\n\n* [`tracing-attributes`]: Procedural macro attributes for automatically\n    instrumenting functions. ([crates.io][attr-crates]|[docs][attr-docs])\n\n* [`tracing-log`]: Compatibility with the `log` crate (unstable).\n\n* [`tracing-serde`]: A compatibility layer for serializing trace data with\n    `serde` (unstable).\n\n* [`tracing-subscriber`]: Subscriber implementations, and utilities for\n  implementing and composing `Subscriber`s.\n  ([crates.io][sub-crates]|[docs][sub-docs])\n\n* [`tracing-tower`]: Compatibility with the `tower` ecosystem (unstable).\n\n* [`tracing-appender`]: Utilities for outputting tracing data, including a file appender\n   and non-blocking writer. ([crates.io][app-crates]|[docs][app-docs])\n\n* [`tracing-error`]: Provides `SpanTrace`, a type for instrumenting errors with\n  tracing spans. ([crates.io][err-crates]|[docs][err-docs])\n\n* [`tracing-flame`]: Provides a layer for generating flame graphs based on\n  tracing span entry \u002F exit events. ([crates.io][flame-crates]|[docs][flame-docs])\n\n* [`tracing-journald`]: Provides a layer for recording events to the\n  Linux `journald` service, preserving structured data. ([crates.io][jour-crates]|[docs][jour-docs])\n\n[`tracing`]: tracing\n[`tracing-core`]: tracing-core\n[`tracing-futures`]: tracing-futures\n[`tracing-macros`]: tracing-macros\n[`tracing-attributes`]: tracing-attributes\n[`tracing-log`]: tracing-log\n[`tracing-serde`]: tracing-serde\n[`tracing-subscriber`]: tracing-subscriber\n[`tracing-tower`]: tracing-tower\n[`tracing-appender`]: tracing-appender\n[`tracing-error`]: tracing-error\n[`tracing-flame`]: tracing-flame\n[`tracing-journald`]: tracing-journald\n\n[fut-crates]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-futures\n[fut-docs]: https:\u002F\u002Fdocs.rs\u002Ftracing-futures\n\n[attr-crates]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-attributes\n[attr-docs]: https:\u002F\u002Fdocs.rs\u002Ftracing-attributes\n\n[sub-crates]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-subscriber\n[sub-docs]: https:\u002F\u002Fdocs.rs\u002Ftracing-subscriber\n\n[otel-crates]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-opentelemetry\n[otel-docs]: https:\u002F\u002Fdocs.rs\u002Ftracing-opentelemetry\n[OpenTelemetry]: https:\u002F\u002Fopentelemetry.io\u002F\n\n[app-crates]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-appender\n[app-docs]: https:\u002F\u002Fdocs.rs\u002Ftracing-appender\n\n[err-crates]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-error\n[err-docs]: https:\u002F\u002Fdocs.rs\u002Ftracing-error\n\n[flame-crates]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-flame\n[flame-docs]: https:\u002F\u002Fdocs.rs\u002Ftracing-flame\n\n[jour-crates]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-journald\n[jour-docs]: https:\u002F\u002Fdocs.rs\u002Ftracing-journald\n\n## Related Crates\n\nIn addition to this repository, here are also several third-party crates which\nare not maintained by the `tokio` project. These include:\n\n- [`tracing-timing`] implements inter-event timing metrics on top of `tracing`.\n  It provides a subscriber that records the time elapsed between pairs of\n  `tracing` events and generates histograms.\n- [`tracing-honeycomb`] Provides a layer that reports traces spanning multiple machines to [honeycomb.io]. Backed by [`tracing-distributed`].\n- [`tracing-distributed`] Provides a generic implementation of a layer that reports traces spanning multiple machines to some backend.\n- [`tracing-actix-web`] provides `tracing` integration for the `actix-web` web framework.\n- [`tracing-actix`] provides `tracing` integration for the `actix` actor\n  framework.\n- [`axum-insights`] provides `tracing` integration and Application insights export for the `axum` web framework.\n- [`tracing-gelf`] implements a subscriber for exporting traces in Graylog\n  GELF format.\n- [`tracing-coz`] provides integration with the [coz] causal profiler\n  (Linux-only).\n- [`tracing-bunyan-formatter`] provides a layer implementation that reports events and spans in [bunyan] format, enriched with timing information.\n- [`tide-tracing`] provides a [tide] middleware to trace all incoming requests and responses.\n- [`color-spantrace`] provides a formatter for rendering span traces in the\n  style of `color-backtrace`\n- [`color-eyre`] provides customized panic and eyre report handlers for\n  `eyre::Report` for capturing span traces and backtraces with new errors and\n  pretty printing them.\n- [`spandoc`] provides a proc macro for constructing spans from doc comments\n  _inside_ of functions.\n- [`tracing-wasm`] provides a `Subscriber`\u002F`Layer` implementation that reports\n  events and spans via browser `console.log` and [User Timing API (`window.performance`)].\n- [`tracing-web`] provides a layer implementation of level-aware logging of events\n  to web browsers' `console.*` and span events to the [User Timing API (`window.performance`)].\n- [`test-log`] takes care of initializing `tracing` for tests, based on\n  environment variables with an `env_logger` compatible syntax.\n- [`tracing-unwrap`] provides convenience methods to report failed unwraps on `Result` or `Option` types to a `Subscriber`.\n- [`diesel-tracing`] provides integration with [`diesel`] database connections.\n- [`tracing-tracy`] provides a way to collect [Tracy] profiles in instrumented\n  applications.\n- [`tracing-elastic-apm`] provides a layer for reporting traces to [Elastic APM].\n- [`tracing-etw`] provides a layer for emitting Windows [ETW] events.\n- [`sentry-tracing`] provides a layer for reporting events and traces to [Sentry].\n- [`tracing-forest`] provides a subscriber that preserves contextual coherence by\n  grouping together logs from the same spans during writing.\n- [`tracing-loki`] provides a layer for shipping logs to [Grafana Loki].\n- [`tracing-logfmt`] provides a layer that formats events and spans into the logfmt format.\n- [`tracing-chrome`] provides a layer that exports trace data that can be viewed in `chrome:\u002F\u002Ftracing`.\n- [`reqwest-tracing`] provides a middleware to trace [`reqwest`] HTTP requests.\n- [`tracing-cloudwatch`] provides a layer that sends events to AWS CloudWatch Logs.\n- [`tracing-subscriber-reload-arcswap`] provides a lock-free alternative to `tracing_subscriber::reload::Layer` using `arc-swap`.\n- [`clippy-tracing`] provides a tool to add, remove and check for `tracing::instrument`.\n\n(if you're the maintainer of a `tracing` ecosystem crate not in this list,\nplease let us know!)\n\n[`tracing-timing`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-timing\n[`tracing-honeycomb`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-honeycomb\n[`tracing-distributed`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-distributed\n[honeycomb.io]: https:\u002F\u002Fwww.honeycomb.io\u002F\n[`tracing-actix`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-actix\n[`tracing-actix-web`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-actix-web\n[`axum-insights`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Faxum-insights\n[`tracing-gelf`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-gelf\n[`tracing-coz`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-coz\n[coz]: https:\u002F\u002Fgithub.com\u002Fplasma-umass\u002Fcoz\n[`tracing-bunyan-formatter`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-bunyan-formatter\n[`tide-tracing`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftide-tracing\n[tide]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftide\n[bunyan]: https:\u002F\u002Fgithub.com\u002Ftrentm\u002Fnode-bunyan\n[`color-spantrace`]: https:\u002F\u002Fdocs.rs\u002Fcolor-spantrace\n[`color-eyre`]: https:\u002F\u002Fdocs.rs\u002Fcolor-eyre\n[`spandoc`]: https:\u002F\u002Fdocs.rs\u002Fspandoc\n[`tracing-wasm`]: https:\u002F\u002Fdocs.rs\u002Ftracing-wasm\n[`tracing-web`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-web\n[`test-log`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftest-log\n[User Timing API (`window.performance`)]: https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FUser_Timing_API\n[`tracing-unwrap`]: https:\u002F\u002Fdocs.rs\u002Ftracing-unwrap\n[`diesel`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Fdiesel\n[`diesel-tracing`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Fdiesel-tracing\n[`tracing-tracy`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-tracy\n[Tracy]: https:\u002F\u002Fgithub.com\u002Fwolfpld\u002Ftracy\n[`tracing-elastic-apm`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-elastic-apm\n[Elastic APM]: https:\u002F\u002Fwww.elastic.co\u002Fapm\n[`tracing-etw`]: https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Frust_win_etw\u002Ftree\u002Fmain\u002Fwin_etw_tracing\n[ETW]: https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fwin32\u002Fetw\u002Fabout-event-tracing\n[`sentry-tracing`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Fsentry-tracing\n[Sentry]: https:\u002F\u002Fsentry.io\u002Fwelcome\u002F\n[`tracing-forest`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-forest\n[`tracing-loki`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-loki\n[Grafana Loki]: https:\u002F\u002Fgrafana.com\u002Foss\u002Floki\u002F\n[`tracing-logfmt`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-logfmt\n[`tracing-chrome`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-chrome\n[`reqwest-tracing`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Freqwest-tracing\n[`reqwest`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Freqwest\n[`tracing-cloudwatch`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-cloudwatch\n[`tracing-subscriber-reload-arcswap`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftracing-subscriber-reload-arcswap\n[`clippy-tracing`]: https:\u002F\u002Fcrates.io\u002Fcrates\u002Fclippy-tracing\n\n**Note:** that some of the ecosystem crates are currently unreleased and\nundergoing active development. They may be less stable than `tracing` and\n`tracing-core`.\n\n## External Resources\n\nThis is a list of links to blog posts, conference talks, and tutorials about\nTracing.\n\n#### Blog Posts\n\n* [Diagnostics with Tracing][tokio-blog-2019-08] on the Tokio blog, August 2019\n* [Production-Grade Logging in Rust Applications][production-logging-2020], November 2020\n* [Custom Logging in Rust using `tracing` and `tracing-subscriber`, part 1][custom-logging-part-1] and [part 2][custom-logging-part-2], October 2021\n* [Instrumenting Axum projects][detsys-blog-2023-08], August 2023\n\n[tokio-blog-2019-08]: https:\u002F\u002Ftokio.rs\u002Fblog\u002F2019-08-tracing\u002F\n[detsys-blog-2023-08]: https:\u002F\u002Fdeterminate.systems\u002Fposts\u002Finstrumenting-axum\n\n#### Talks\n\n* [Bay Area Rust Meetup talk and Q&A][bay-rust-2019-03], March 2019\n* [RustConf 2019 talk][rust-conf-2019-08-video] and [slides][rust-conf-2019-08-slides], August 2019\n* [Are we observable yet? @ RustyDays talk][rusty-days-2020-08-video] and [slides][rusty-days-2020-08-slides], August 2020\n* [Crabs with instruments!][tremorcon-2021-09], September 2021\n* [Decrusting the tracing crate by Jon Gjengset][decrusting-tracing-2024-02], February 2024\n\n[bay-rust-2019-03]: https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=j_kXRg3zlec\n[rust-conf-2019-08-video]: https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=JjItsfqFIdo\n[rust-conf-2019-08-slides]: https:\u002F\u002Fwww.elizas.website\u002Fslides\u002Frustconf-8-2019.pdf\n[rusty-days-2020-08-video]: https:\u002F\u002Fyoutu.be\u002FHtKnLiFwHJM\n[rusty-days-2020-08-slides]: https:\u002F\u002Fdocs.google.com\u002Fpresentation\u002Fd\u002F1zrxJs7fJgQ29bKfnAll1bYTo9cYZxsCZUwDDtyp5Fak\u002Fedit?usp=sharing\n[production-logging-2020]: https:\u002F\u002Fmedium.com\u002Fbetter-programming\u002Fproduction-grade-logging-in-rust-applications-2c7fffd108a6\n[custom-logging-part-1]: https:\u002F\u002Fburgers.io\u002Fcustom-logging-in-rust-using-tracing\n[custom-logging-part-2]: https:\u002F\u002Fburgers.io\u002Fcustom-logging-in-rust-using-tracing-part-2\n[tremorcon-2021-09]: https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=ZC7fyqshun8\n[decrusting-tracing-2024-02]: https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=21rtHinFA40\n\nHelp us expand this list! If you've written or spoken about Tracing, or\nknow of resources that aren't listed, please open a pull request adding them.\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in Tracing by you, shall be licensed as MIT, without any additional\nterms or conditions.\n","`tracing` 是一个为 Rust 应用程序提供结构化、基于事件的诊断信息收集框架。它支持开发者通过定义事件和跨度来跟踪应用程序的行为，从而帮助理解程序执行流程和性能瓶颈。核心功能包括细粒度的日志记录与监控指标收集，以及与其他日志库如 `log` 的良好兼容性。该库特别适用于需要进行深度调试或性能调优的复杂系统开发场景中，能够显著提高问题定位效率。此外，`tracing` 不依赖于特定的运行时环境，使得其在多种Rust项目中都能灵活运用。","2026-06-11 03:04:19","top_language"]