NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #124 most downloaded on crates.io
Procedural macro attributes for automatically instrumenting functions.
Last release 10 months ago
26 Nov 2025
Release timing varies
gaps range from 2 weeks to 1.1 years
Nearly every release is documented
notes for 30 of 30 stable releases
2 versions withdrawn
withdrawn after publishing
7 years old
32 releases · first in 2019
Support constant expressions as instrument field names ([#3158])
Fix tracing::instrument regression around shadowing ([#3311])
tracing::instrument regression around shadowing (#3311)One column per quarter.
Let dead_code lint work on #[instrument]ed functions ([#3108])
Added missing RecordTypes for instrument ([#2781])
target and name (#2941)Bump minimum version of proc-macro2 to 1.0.60 ([#2732])
This release of tracing-attributes fixes warnings due to allow attributes in generated code that allow lints which may not exist on earlier versions o
This release of tracing-attributes fixes warnings due to allow attributes in
generated code that allow lints which may not exist on earlier versions of rustc.
unknown_lints in macro-generated code ([#2626])Thanks to @mladedav for contributing to this release!
This release of tracing-attributes fixes the Clippy lint [let_with_type_underscore] in code generated by the #[instrument] attribute in Rust 1.70+.
This release of tracing-attributes fixes the Clippy lint
let_with_type_underscore in code generated by the #[instrument]
attribute in Rust 1.70+.
clippy::let_with_type_underscore] in macro-generated code (#2609)Thanks to @coolreader19 for contributing to this release!
This release of tracing-attributes adds support for passing an optional level to the err and ret arguments to #[instrument], allowing the level of the
This release of tracing-attributes adds support for passing an optional
level to the err and ret arguments to #[instrument], allowing the level
of the generated return-value event to be overridden. For example,
#[instrument(err(level = "info"))]
fn my_great_function() -> Result<(), &'static str> {
// ...
}
will emit an INFO-level event if the function returns an Err.
In addition, this release updates the syn dependency to v2.x.x.
level argument to err and ret to override the level of the generated
return value event (#2335)#[instrument] is added to a const fn
(#2418)syn dependency to 2.0 (#2516)clippy::unreachable warnings in #[instrument]-generated code (#2356)syn dependency (#2530)Thanks to @nitnelave, @jsgf, @Abhicodes-crypto, @LukeMathWalker, @andrewpollack, @quad, @klensy, @davidpdrsn, and @dbidwell94 for contributign to this release!
This release of tracing-attributes fixes a bug where compiler diagnostic spans for type errors in #[instrument]ed async fns have the location of the #
This release of tracing-attributes fixes a bug where compiler diagnostic spans
for type errors in #[instrument]ed async fns have the location of the
#[instrument] attribute rather than the location of the actual error, and a
bug where inner attributes in #[instrument]ed functions would cause a compiler
error.
#[instrument]ed functions (#2307)async fns (#2270)syn dependency to fix compilation with -Z minimal-versions
(#2246)Thanks to new contributors @compiler-errors and @e-nomem, as well as @CAD97, for contributing to this release!
This release fixes an issue where using the err or ret arguments to #[instrument] along with an overridden target, such as
This release fixes an issue where using the err or ret arguments to
#[instrument] along with an overridden target, such as
#[instrument(target = "...", err, ret)]
would not propagate the overridden target to the events generated for errors/return values.
#[instrument(err)] or
#[instrument(ret)] not inheriting an overridden target (#2184)Thanks to new contributor @tbraun96 for contributing to this release!
This release adds support for setting explicit parent and follows-from spans in the #[instrument] attribute.
This release adds support for setting explicit parent and follows-from spans
in the #[instrument] attribute.
#[instrument(follows_from = ...)] argument for setting one or more
follows-from span (#2093)#[instrument(parent = ...)] argument for overriding the generated span's
parent (#2091)async blocks in expanded code (causes a Clippy warning)
(#2090)Thanks to @jarrodldavis, @ben0x539, and new contributor @jswrenn for contributing to this release!
Compilation failure with --minimal-versions due to a too-permissive syn dependency ([#1960])
This release introduces a new #[instrument(ret)] argument to emit an event with the return value of an instrumented function.
This release introduces a new #[instrument(ret)] argument to emit an event
with the return value of an instrumented function.
#[instrument(ret)] to record the return value of a function (#1716)err(Debug) argument to cause #[instrument(err)] to record errors
with Debug rather than `Display (#1631)rust-analyzer (#1634)Thanks to @Swatinem, @hkmatsumoto, @cynecx, and @ciuncan for contributing to this release!
This release fixes issues introduced in v0.1.17.
This release fixes issues introduced in v0.1.17.
#[instrument] on an async fn that returns an impl Trait value that
includes a closure (#1616)clippy::suspicious_else_formatting warnings due to
rust-lang/rust-clippy#7760 and rust-lang/rust-clippy#6249 (#1617)clippy::let_unit_value lints when using #[instrument] (#1614)This release significantly improves performance when #[instrument]-generated spans are below the maximum enabled level.
This release adds a new #[instrument(skip_all)] option to skip recording *all* arguments to an instrumented function as fields. Additionally, it adds
This release adds a new #[instrument(skip_all)] option to skip recording all
arguments to an instrumented function as fields. Additionally, it adds support
for recording arguments that are tracing primitive types as typed values,
rather than as fmt::Debug.
skip_all option to #[instrument] (#1548)fmt::Debug
(#1378)f64s as typed values (#1522)Thanks to @Folyd and @jsgf for contributing to this release!
Thanks to @nightmared for contributing to this release!
#[instrument] on functions returning Box::pinned futures incorrectly
skipping function bodies prior to returning a future (#1297)Thanks to @nightmared for contributing to this release!
Compatibility between #[instrument] and async-trait v0.1.43 and newer ([#1228])
#[instrument] and async-trait v0.1.43 and newer
(#1228)Thanks to @nightmared for lots of hard work on this fix!
Compiler error when using #[instrument(err)] on functions which return impl Trait ([#1236])
#[instrument(err)] on functions which return impl Trait (#1236)Compiler error when using #[instrument(err)] on functions with mutable parameters ([#1167])
#[instrument(err)] on functions with mutable
parameters (#1167)#[instrument] with
async-trait (#977)tracing-futures dependency is no longer required when using #[instrument]
on async functions (#808)Thanks to @nagisa, @Txuritan, @TaKO8Ki, and @okready for contributing to this release!
Corrected wrong minimum supported Rust version note in docs
syn features (#928)Thanks to new contributor @jhpratt for contributing to this release!
Support for using self in field expressions when instrumenting async-trait functions
self in field expressions when instrumenting async-trait
functions (#875)Thanks to @anton-dutov and @nightmared for contributing to this release!
Support for arbitrary expressions as fields in #[instrument]
#[instrument] (#672)#[instrument] now emits a compiler warning when ignoring unrecognized
input (#672, #786)Support for using #[instrument] on methods that are part of [async-trait] trait implementations
#[instrument] on methods that are part of async-trait
trait implementations (#711)#[instrument(err)] argument to automatically emit an event if an
instrumented function returns Err (#637)Thanks to @ilana and @nightmared for contributing to this release!
Support for adding arbitrary literal fields to spans generated by #[instrument]
#[instrument] (#569)#[instrument] now emits a helpful compiler error when attempting to skip a
function parameter (#600)Thanks to @Kobzol for contributing to this release!
### Added - Updated documentation
Support for destructuring in arguments to #[instrument]ed functions
#[instrument]ed functions (#397)self parameters when #[instrument]ing methods (#397)Optional skip argument to #[instrument] for excluding function parameters from generated spans
skip argument to #[instrument] for excluding function parameters
from generated spans (#359)Fixed #[instrument]ed async functions not compiling on nightly-2019-09-11 or newer
#[instrument]ed async functions not compiling on nightly-2019-09-11
or newer (#342)Updated syn and quote dependencies to 1.0
syn and quote dependencies to 1.0 (#292)proc-macro2 to avoid potential version
conflicts (#296)Using the #[instrument] attribute on async fns no longer requires a feature flag
#[instrument] attribute on async fns no longer requires a
feature flag (#258)#[instrument] macro now works on generic functions (#262)- Initial release
Your coding agent can read these notes before it upgrades. Set up the MCP server →