From 68385f0ff751454c06f25e5899b5b87c22912773 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 18 Mar 2022 14:40:26 +0100 Subject: [PATCH] Add tracing span to request sending --- crates/matrix-sdk/src/http_client.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/matrix-sdk/src/http_client.rs b/crates/matrix-sdk/src/http_client.rs index 2f7d0697c..fab834bed 100644 --- a/crates/matrix-sdk/src/http_client.rs +++ b/crates/matrix-sdk/src/http_client.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::{convert::TryFrom, fmt::Debug, sync::Arc, time::Duration}; +use std::{any::type_name, convert::TryFrom, fmt::Debug, sync::Arc, time::Duration}; use bytes::{Bytes, BytesMut}; use http::Response as HttpResponse; @@ -108,6 +108,10 @@ impl HttpClient { HttpClient { inner, homeserver, session, request_config } } + #[tracing::instrument( + skip(self, request, session), + fields(request_type = type_name::()) + )] async fn send_request( &self, request: Request,