From d057c764530d9d4865dceaf610cf02c6eabc6da1 Mon Sep 17 00:00:00 2001 From: Jean SIMARD Date: Fri, 5 Jul 2024 11:33:09 +0200 Subject: [PATCH] editoast: add telemetry to core requests --- editoast/src/core/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editoast/src/core/mod.rs b/editoast/src/core/mod.rs index 771953e4609..e6c15d83cf9 100644 --- a/editoast/src/core/mod.rs +++ b/editoast/src/core/mod.rs @@ -98,6 +98,7 @@ impl CoreClient { CoreError::UnparsableErrorOutput.into() } + #[tracing::instrument(target= "editoast::coreclient", name = "core:fetch", skip(self, body), err)] async fn fetch( &self, method: reqwest::Method, @@ -105,8 +106,10 @@ impl CoreClient { body: Option<&B>, ) -> Result { let method_s = colored_method(&method); - info!(target: "editoast::coreclient", "{method_s} {path}"); - debug!(target: "editoast::coreclient", "Request content: {body}", body = body.and_then(|b| serde_json::to_string_pretty(b).ok()).unwrap_or_default()); + debug!( + target: "editoast::coreclient", + body = body.and_then(|b| serde_json::to_string_pretty(b).ok()).unwrap_or_default(), + "Request content"); match self { CoreClient::Direct(client) => { let mut i_try = 0;