From 7a1647a5dca63e4e5f29a00d7f3a9d02415708c1 Mon Sep 17 00:00:00 2001 From: Anton Dutov Date: Fri, 7 Aug 2020 15:04:00 +0300 Subject: [PATCH] Docs for instrument(name) --- tracing-attributes/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs index a8d3aadc64..848e58391a 100644 --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -121,6 +121,14 @@ use syn::{ /// // ... /// } /// ``` +/// Overriding the generated span's name: +/// ``` +/// # use tracing_attributes::instrument; +/// #[instrument(name = "my_name")] +/// pub fn my_function() { +/// // ... +/// } +/// ``` /// Overriding the generated span's target: /// ``` /// # use tracing_attributes::instrument;