diff --git a/CHANGELOG.md b/CHANGELOG.md index 80276721..edbf4e84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.0.4 + +* Fix tracing span annotations. + ## 8.0.3 * Box large futures to reduce stack usage. diff --git a/Cargo.toml b/Cargo.toml index a91d182c..f0eb5365 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fred" -version = "8.0.3" +version = "8.0.4" authors = ["Alec Embke "] edition = "2021" description = "An async Redis client built on Tokio." diff --git a/src/trace/enabled.rs b/src/trace/enabled.rs index 40dfeada..e0867208 100644 --- a/src/trace/enabled.rs +++ b/src/trace/enabled.rs @@ -53,7 +53,8 @@ pub fn set_network_span(inner: &Arc, command: &mut RedisComman } pub fn record_response_size(span: &Span, frame: &Frame) { - span.record("res_size", protocol_utils::resp3_frame_size(frame)); + #[allow(clippy::needless_borrows_for_generic_args)] + span.record("res_size", &protocol_utils::resp3_frame_size(frame)); } pub fn create_command_span(inner: &Arc) -> Span { diff --git a/src/utils.rs b/src/utils.rs index a704b9d1..ef17e29e 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -442,6 +442,8 @@ where /// Send a command to the server, with tracing. #[cfg(any(feature = "full-tracing", feature = "partial-tracing"))] +#[allow(clippy::needless_borrows_for_generic_args)] +// despite what clippy says, this^ actually matters for tracing `record` calls (at least it seems where `V: Copy`) pub async fn request_response(client: &C, func: F) -> Result where C: ClientLike, @@ -458,18 +460,19 @@ where let (mut command, rx, req_size) = { let args_span = trace::create_args_span(cmd_span.id(), inner); - let _enter = args_span.enter(); + #[allow(clippy::let_unit_value)] + let _guard = args_span.enter(); let (tx, rx) = oneshot_channel(); let mut command: RedisCommand = func()?.into(); command.response = ResponseKind::Respond(Some(tx)); let req_size = protocol_utils::args_size(command.args()); - args_span.record("num_args", command.args().len()); + args_span.record("num_args", &command.args().len()); (command, rx, req_size) }; - cmd_span.record("cmd", command.kind.to_str_debug()); - cmd_span.record("req_size", req_size); + cmd_span.record("cmd", &command.kind.to_str_debug()); + cmd_span.record("req_size", &req_size); let queued_span = trace::create_queued_span(cmd_span.id(), inner); let timed_out = command.timed_out.clone();