From ef9298a59df4b72e1287df9f91aeb815d861b8b8 Mon Sep 17 00:00:00 2001 From: Duncan Harvey Date: Thu, 22 Jan 2026 11:11:50 -0500 Subject: [PATCH 1/2] add log detail to logs from datadog-serverless-compat --- crates/datadog-serverless-compat/src/main.rs | 2 +- crates/datadog-trace-agent/src/mini_agent.rs | 4 ++-- .../datadog-trace-agent/src/proxy_flusher.rs | 22 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/datadog-serverless-compat/src/main.rs b/crates/datadog-serverless-compat/src/main.rs index 18d1c5e2..f7636276 100644 --- a/crates/datadog-serverless-compat/src/main.rs +++ b/crates/datadog-serverless-compat/src/main.rs @@ -94,7 +94,7 @@ pub async fn main() { .with_thread_ids(false) .with_line_number(false) .with_file(false) - .with_target(false) + .with_target(true) .without_time() .finish(); diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index 93db84d7..286e69e0 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -239,7 +239,7 @@ impl MiniAgent { request: hyper_migration::HttpRequest, proxy_tx: Sender, ) -> http::Result { - debug!("Trace Agent | Received profiling request"); + debug!("Received profiling request"); // Extract headers and body let (parts, body) = request.into_parts(); @@ -269,7 +269,7 @@ impl MiniAgent { }; debug!( - "Trace Agent | Sending profiling request to channel, target: {}", + "Sending profiling request to channel, target: {}", proxy_request.target_url ); diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 0d13cf8e..6b3a7aa4 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -38,7 +38,7 @@ pub struct ProxyFlusher { impl ProxyFlusher { pub fn new(config: Arc) -> Self { debug!( - "Proxy Flusher | Creating new proxy flusher with target URL: {}", + "Creating new proxy flusher with target URL: {}", config.profiling_intake.url ); let client = build_client( @@ -58,15 +58,15 @@ impl ProxyFlusher { /// Starts the proxy flusher that listens for proxy payloads from the channel and forwards them to Datadog pub async fn start_proxy_flusher(&self, mut rx: Receiver) { let Some(api_key) = self.config.profiling_intake.api_key.as_ref() else { - error!("Proxy Flusher | No API key configured, cannot start"); + error!("No API key configured, cannot start"); return; }; - debug!("Proxy Flusher | Started, listening for requests"); + debug!("Started, listening for requests"); while let Some(proxy_payload) = rx.recv().await { debug!( - "Proxy Flusher | Received request from channel, body size: {} bytes", + "Received request from channel, body size: {} bytes", proxy_payload.body.len() ); self.send_request(proxy_payload, api_key).await; @@ -132,13 +132,13 @@ impl ProxyFlusher { let request_builder = match self.create_request(&request, api_key).await { Ok(builder) => builder, Err(e) => { - error!("Proxy Flusher | {}", e); + error!("{}", e); return; } }; debug!( - "Proxy Flusher | Sending request (attempt {}/{})", + "Sending request (attempt {}/{})", attempts, max_retries ); @@ -153,23 +153,23 @@ impl ProxyFlusher { let body = r.text().await; if status == 202 { debug!( - "Proxy Flusher | Successfully sent request in {} ms to {url}", + "Successfully sent request in {} ms to {url}", elapsed.as_millis() ); } else { - error!("Proxy Flusher | Request failed with status {status}: {body:?}"); + error!("Request failed with status {status}: {body:?}"); } return; } Err(e) => { // Only retry on network errors error!( - "Proxy Flusher | Network error (attempt {}): {:?}", + "Network error (attempt {}): {:?}", attempts, e ); if attempts >= max_retries { error!( - "Proxy Flusher | Failed to send request after {} attempts: {:?}", + "Failed to send request after {} attempts: {:?}", attempts, e ); return; @@ -177,7 +177,7 @@ impl ProxyFlusher { // Exponential backoff before retry let backoff_ms = self.config.proxy_request_retry_backoff_base_ms * (2_u64.pow(attempts - 1)); - debug!("Proxy Flusher | Retrying after {}ms backoff", backoff_ms); + debug!("Retrying after {}ms backoff", backoff_ms); tokio::time::sleep(Duration::from_millis(backoff_ms)).await; } } From a3ae1ad0d7ab96a5bc7316bc77378128b9f39fa3 Mon Sep 17 00:00:00 2001 From: Duncan Harvey Date: Thu, 22 Jan 2026 13:25:53 -0500 Subject: [PATCH 2/2] apply formatting --- crates/datadog-trace-agent/src/proxy_flusher.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 6b3a7aa4..d78a7eaf 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -137,10 +137,7 @@ impl ProxyFlusher { } }; - debug!( - "Sending request (attempt {}/{})", - attempts, max_retries - ); + debug!("Sending request (attempt {}/{})", attempts, max_retries); let time = std::time::Instant::now(); let response = request_builder.send().await; @@ -163,10 +160,7 @@ impl ProxyFlusher { } Err(e) => { // Only retry on network errors - error!( - "Network error (attempt {}): {:?}", - attempts, e - ); + error!("Network error (attempt {}): {:?}", attempts, e); if attempts >= max_retries { error!( "Failed to send request after {} attempts: {:?}",