diff --git a/README.md b/README.md index 7fb11378ff..054f999b48 100644 --- a/README.md +++ b/README.md @@ -403,6 +403,8 @@ are not maintained by the `tokio` project. These include: - [`tracing-logfmt`] provides a layer that formats events and spans into the logfmt format. - [`tracing-chrome`] provides a layer that exports trace data that can be viewed in `chrome://tracing`. - [`reqwest-tracing`] provides a middleware to trace [`reqwest`] HTTP requests. +- [`tracing-cloudwatch`] provides a layer that sends events to AWS CloudWatch Logs. +- [`clippy-tracing`] provides a tool to add, remove and check for `tracing::instrument`. (if you're the maintainer of a `tracing` ecosystem crate not in this list, please let us know!) @@ -445,6 +447,8 @@ please let us know!) [`tracing-chrome`]: https://crates.io/crates/tracing-chrome [`reqwest-tracing`]: https://crates.io/crates/reqwest-tracing [`reqwest`]: https://crates.io/crates/reqwest +[`tracing-cloudwatch`]: https://crates.io/crates/tracing-cloudwatch +[`clippy-tracing`]: https://crates.io/crates/clippy-tracing **Note:** that some of the ecosystem crates are currently unreleased and undergoing active development. They may be less stable than `tracing` and @@ -460,14 +464,17 @@ Tracing. * [Diagnostics with Tracing][tokio-blog-2019-08] on the Tokio blog, August 2019 * [Production-Grade Logging in Rust Applications][production-logging-2020], November 2020 * [Custom Logging in Rust using `tracing` and `tracing-subscriber`, part 1][custom-logging-part-1] and [part 2][custom-logging-part-2], October 2021 +* [Instrumenting Axum projects][detsys-blog-2023-08], August 2023 [tokio-blog-2019-08]: https://tokio.rs/blog/2019-08-tracing/ +[detsys-blog-2023-08]: https://determinate.systems/posts/instrumenting-axum #### Talks * [Bay Area Rust Meetup talk and Q&A][bay-rust-2019-03], March 2019 * [RustConf 2019 talk][rust-conf-2019-08-video] and [slides][rust-conf-2019-08-slides], August 2019 * [Are we observable yet? @ RustyDays talk][rusty-days-2020-08-video] and [slides][rusty-days-2020-08-slides], August 2020 +* [Crabs with instruments!][tremorcon-2021-09], September 2021 [bay-rust-2019-03]: https://www.youtube.com/watch?v=j_kXRg3zlec [rust-conf-2019-08-video]: https://www.youtube.com/watch?v=JjItsfqFIdo @@ -477,6 +484,7 @@ Tracing. [production-logging-2020]: https://medium.com/better-programming/production-grade-logging-in-rust-applications-2c7fffd108a6 [custom-logging-part-1]: https://burgers.io/custom-logging-in-rust-using-tracing [custom-logging-part-2]: https://burgers.io/custom-logging-in-rust-using-tracing-part-2 +[tremorcon-2021-09]: https://www.youtube.com/watch?v=ZC7fyqshun8 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. diff --git a/tracing-core/src/field.rs b/tracing-core/src/field.rs index b754c9ecbf..d4c95aa62f 100644 --- a/tracing-core/src/field.rs +++ b/tracing-core/src/field.rs @@ -1,8 +1,8 @@ //! Span and `Event` key-value data. //! -//! Spans and events may be annotated with key-value data, referred to as known -//! as _fields_. These fields consist of a mapping from a key (corresponding to -//! a `&str` but represented internally as an array index) to a [`Value`]. +//! Spans and events may be annotated with key-value data, known as _fields_. +//! These fields consist of a mapping from a key (corresponding to a `&str` but +//! represented internally as an array index) to a [`Value`]. //! //! # `Value`s and `Collect`s //! @@ -957,8 +957,9 @@ mod test { use super::*; use crate::metadata::{Kind, Level, Metadata}; - struct TestCallsite1; - static TEST_CALLSITE_1: TestCallsite1 = TestCallsite1; + // Make sure TEST_CALLSITE_* have non-zero size, so they can't be located at the same address. + struct TestCallsite1(u8); + static TEST_CALLSITE_1: TestCallsite1 = TestCallsite1(0); static TEST_META_1: Metadata<'static> = metadata! { name: "field_test1", target: module_path!(), @@ -978,8 +979,8 @@ mod test { } } - struct TestCallsite2; - static TEST_CALLSITE_2: TestCallsite2 = TestCallsite2; + struct TestCallsite2(u8); + static TEST_CALLSITE_2: TestCallsite2 = TestCallsite2(0); static TEST_META_2: Metadata<'static> = metadata! { name: "field_test2", target: module_path!(), diff --git a/tracing-journald/src/socket.rs b/tracing-journald/src/socket.rs index bba53d8658..6803bf34e0 100644 --- a/tracing-journald/src/socket.rs +++ b/tracing-journald/src/socket.rs @@ -68,7 +68,7 @@ pub fn send_one_fd_to>(socket: &UnixDatagram, fd: RawFd, path: P) msg.msg_control = unsafe { cmsg_buffer.buffer.as_mut_ptr() as _ }; msg.msg_controllen = unsafe { CMSG_SPACE(size_of::() as _) as _ }; - let mut cmsg: &mut cmsghdr = + let cmsg: &mut cmsghdr = unsafe { CMSG_FIRSTHDR(&msg).as_mut() }.expect("Control message buffer exhausted"); cmsg.cmsg_level = SOL_SOCKET; diff --git a/tracing-subscriber/src/fmt/time/mod.rs b/tracing-subscriber/src/fmt/time/mod.rs index fd77b2c750..21d692bbb0 100644 --- a/tracing-subscriber/src/fmt/time/mod.rs +++ b/tracing-subscriber/src/fmt/time/mod.rs @@ -48,7 +48,7 @@ pub trait FormatTime { /// # } /// ``` pub fn time() -> SystemTime { - SystemTime::default() + SystemTime } /// Returns a new `Uptime` timestamp provider. diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs index 1494048523..f698648232 100644 --- a/tracing/src/lib.rs +++ b/tracing/src/lib.rs @@ -808,6 +808,8 @@ //! - [`tracing-loki`] provides a layer for shipping logs to [Grafana Loki]. //! - [`tracing-logfmt`] provides a layer that formats events and spans into the logfmt format. //! - [`reqwest-tracing`] provides a middleware to trace [`reqwest`] HTTP requests. +//! - [`tracing-cloudwatch`] provides a layer that sends events to AWS CloudWatch Logs. +//! - [`clippy-tracing`] provides a tool to add, remove and check for `tracing::instrument`. //! //! 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! @@ -848,6 +850,8 @@ //! [`tracing-logfmt`]: https://crates.io/crates/tracing-logfmt //! [`reqwest-tracing`]: https://crates.io/crates/reqwest-tracing //! [`reqwest`]: https://crates.io/crates/reqwest +//! [`tracing-cloudwatch`]: https://crates.io/crates/tracing-cloudwatch +//! [`clippy-tracing`]: https://crates.io/crates/clippy-tracing //! //!
//!