From b9e66d53fba336f7c4f5923168156d08c558b5d4 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Wed, 1 Oct 2025 14:39:11 -0400 Subject: [PATCH 01/33] Handle proxy payload --- Cargo.lock | 302 +++++++++++++++--- crates/datadog-trace-agent/Cargo.toml | 2 + crates/datadog-trace-agent/src/lib.rs | 1 + crates/datadog-trace-agent/src/mini_agent.rs | 76 ++++- .../src/proxy_aggregator.rs | 38 +++ 5 files changed, 370 insertions(+), 49 deletions(-) create mode 100644 crates/datadog-trace-agent/src/proxy_aggregator.rs diff --git a/Cargo.lock b/Cargo.lock index fedb9936..98a17f99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -350,6 +350,16 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation" version = "0.10.0" @@ -457,6 +467,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", + "bytes", "duplicate", "http-body-util", "hyper", @@ -466,6 +477,7 @@ dependencies = [ "libdd-trace-obfuscation", "libdd-trace-protobuf", "libdd-trace-utils", + "reqwest", "rmp-serde", "serde", "serde_json", @@ -577,6 +589,15 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -651,6 +672,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1016,7 +1052,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots", + "webpki-roots 0.26.8", ] [[package]] @@ -1035,26 +1071,49 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots", + "webpki-roots 0.26.8", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", ] [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" dependencies = [ + "base64 0.22.1", "bytes", "futures-channel", + "futures-core", "futures-util", "http", "http-body", "hyper", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", - "socket2", + "socket2 0.6.1", + "system-configuration", "tokio", "tower-service", "tracing", + "windows-registry", ] [[package]] @@ -1212,6 +1271,16 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +[[package]] +name = "iri-string" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "itertools" version = "0.12.1" @@ -1269,9 +1338,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.178" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" [[package]] name = "libdd-common" @@ -1502,6 +1571,23 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework 2.11.1", + "security-framework-sys", + "tempfile", +] + [[package]] name = "nix" version = "0.29.0" @@ -1558,12 +1644,50 @@ version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +[[package]] +name = "openssl" +version = "0.10.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "openssl-probe" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-sys" +version = "0.9.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "ordered-float" version = "4.6.0" @@ -1872,7 +1996,7 @@ dependencies = [ "quinn-udp", "rustc-hash 2.1.1", "rustls", - "socket2", + "socket2 0.5.8", "thiserror 2.0.12", "tokio", "tracing", @@ -1908,7 +2032,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2", + "socket2 0.5.8", "tracing", "windows-sys 0.59.0", ] @@ -2052,46 +2176,46 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.15" +version = "0.12.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" +checksum = "3b4c14b2d9afca6a60277086b0cc6a6ae0b568f6f7916c943a8cdc79f8be240f" dependencies = [ "base64 0.22.1", "bytes", + "encoding_rs", "futures-core", - "futures-util", "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", + "hyper-tls", "hyper-util", - "ipnet", "js-sys", "log", "mime", - "once_cell", + "native-tls", "percent-encoding", "pin-project-lite", "quinn", "rustls", - "rustls-pemfile", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "tokio", + "tokio-native-tls", "tokio-rustls", "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", - "windows-registry", + "webpki-roots 1.0.4", ] [[package]] @@ -2208,16 +2332,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", + "security-framework 3.2.0", ] [[package]] @@ -2280,6 +2395,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + [[package]] name = "security-framework" version = "3.2.0" @@ -2287,7 +2415,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ "bitflags", - "core-foundation", + "core-foundation 0.10.0", "core-foundation-sys", "libc", "security-framework-sys", @@ -2466,6 +2594,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "socket2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2531,6 +2669,27 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tabwriter" version = "1.4.1" @@ -2640,7 +2799,7 @@ dependencies = [ "mio", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.8", "tokio-macros", "windows-sys 0.52.0", ] @@ -2656,6 +2815,16 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.26.2" @@ -2740,6 +2909,24 @@ dependencies = [ "tower-service", ] +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -2924,6 +3111,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.5" @@ -3063,6 +3256,15 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "webpki-roots" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "which" version = "4.4.2" @@ -3099,37 +3301,43 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-link" -version = "0.1.1" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-registry" -version = "0.4.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" dependencies = [ + "windows-link 0.1.3", "windows-result", "windows-strings", - "windows-targets 0.53.0", ] [[package]] name = "windows-result" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] name = "windows-strings" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -3150,6 +3358,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -3168,10 +3385,11 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.0" +version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ + "windows-link 0.2.1", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", diff --git a/crates/datadog-trace-agent/Cargo.toml b/crates/datadog-trace-agent/Cargo.toml index 26b82905..6d4870de 100644 --- a/crates/datadog-trace-agent/Cargo.toml +++ b/crates/datadog-trace-agent/Cargo.toml @@ -26,6 +26,8 @@ libdd-trace-protobuf = { git = "https://github.com/DataDog/libdatadog", rev = "4 libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "435107c245112397914935c0f7148a18b91cafc6", features = [ "mini_agent", ] } +reqwest = { version = "0.12.23", features = ["json"] } +bytes = "1.10.1" [dev-dependencies] rmp-serde = "1.1.1" diff --git a/crates/datadog-trace-agent/src/lib.rs b/crates/datadog-trace-agent/src/lib.rs index 165c263e..5629d564 100644 --- a/crates/datadog-trace-agent/src/lib.rs +++ b/crates/datadog-trace-agent/src/lib.rs @@ -12,6 +12,7 @@ pub mod config; pub mod env_verifier; pub mod http_utils; pub mod mini_agent; +pub mod proxy_aggregator; pub mod stats_flusher; pub mod stats_processor; pub mod trace_flusher; diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index 0639774c..b3c8f4f8 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -1,6 +1,7 @@ // Copyright 2023-Present Datadog, Inc. https://www.datadoghq.com/ // SPDX-License-Identifier: Apache-2.0 +use http_body_util::BodyExt; use hyper::service::service_fn; use hyper::{http, Method, Response, StatusCode}; use libdd_common::hyper_migration; @@ -9,7 +10,10 @@ use std::io; use std::net::SocketAddr; use std::sync::Arc; use std::time::Instant; -use tokio::sync::mpsc::{self, Receiver, Sender}; +use tokio::sync::{ + Mutex, + mpsc::{self, Receiver, Sender}, +}; use tracing::{debug, error}; use crate::http_utils::log_and_create_http_response; @@ -22,6 +26,7 @@ const MINI_AGENT_PORT: usize = 8126; const TRACE_ENDPOINT_PATH: &str = "/v0.4/traces"; const STATS_ENDPOINT_PATH: &str = "/v0.6/stats"; const INFO_ENDPOINT_PATH: &str = "/info"; +const PROFILING_ENDPOINT_PATH: &str = "/profiling/v1/input"; const TRACER_PAYLOAD_CHANNEL_BUFFER_SIZE: usize = 10; const STATS_PAYLOAD_CHANNEL_BUFFER_SIZE: usize = 10; @@ -32,6 +37,7 @@ pub struct MiniAgent { pub stats_processor: Arc, pub stats_flusher: Arc, pub env_verifier: Arc, + pub proxy_aggregator: Arc>, } impl MiniAgent { @@ -82,10 +88,17 @@ impl MiniAgent { .await; }); + // start our proxy flusher for profiling requests + let proxy_aggregator_for_flusher = self.proxy_aggregator.clone(); + tokio::spawn(async move { + let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(10)); + }); + // setup our hyper http server, where the endpoint_handler handles incoming requests let trace_processor = self.trace_processor.clone(); let stats_processor = self.stats_processor.clone(); let endpoint_config = self.config.clone(); + let proxy_aggregator = self.proxy_aggregator.clone(); let service = service_fn(move |req| { // called for each http request @@ -95,15 +108,17 @@ impl MiniAgent { let stats_tx = stats_tx.clone(); let endpoint_config = endpoint_config.clone(); let mini_agent_metadata = Arc::clone(&mini_agent_metadata); + let proxy_aggregator = proxy_aggregator.clone(); MiniAgent::trace_endpoint_handler( endpoint_config, req.map(hyper_migration::Body::incoming), - trace_processor, - trace_tx, - stats_processor, - stats_tx, - mini_agent_metadata, + trace_processor.clone(), + trace_tx.clone(), + stats_processor.clone(), + stats_tx.clone(), + Arc::clone(&mini_agent_metadata), + proxy_aggregator, ) }); @@ -167,6 +182,7 @@ impl MiniAgent { stats_processor: Arc, stats_tx: Sender, mini_agent_metadata: Arc, + proxy_aggregator: Arc>, ) -> http::Result { match (req.method(), req.uri().path()) { (&Method::PUT | &Method::POST, TRACE_ENDPOINT_PATH) => { @@ -190,6 +206,15 @@ impl MiniAgent { ), } } + (&Method::POST, PROFILING_ENDPOINT_PATH) => { + match Self::profiling_proxy_handler(config, req, proxy_aggregator).await { + Ok(res) => Ok(res), + Err(err) => log_and_create_http_response( + &format!("Error processing profiling request: {err}"), + StatusCode::INTERNAL_SERVER_ERROR, + ), + } + } (_, INFO_ENDPOINT_PATH) => match Self::info_handler(config.dd_dogstatsd_port) { Ok(res) => Ok(res), Err(err) => log_and_create_http_response( @@ -205,13 +230,49 @@ impl MiniAgent { } } + async fn profiling_proxy_handler( + config: Arc, + request: hyper_migration::HttpRequest, + proxy_aggregator: Arc>, + ) -> Result> { + debug!("Trace Agent | Proxied request for profiling"); + + // Extract headers and body + let (parts, body) = request.into_parts(); + if let Some(response) = http_utils::verify_request_content_length( + &parts.headers, + config.max_request_content_length, + "Error processing profiling request", + ) { + return response.map_err(|e| Box::new(e) as Box); + } + + let body_bytes = body.collect().await?.to_bytes(); + + // Create proxy request + let proxy_request = ProxyRequest { + headers: parts.headers, + body: body_bytes, + target_url: format!("https://intake.profile.{}/api/v2/profile", config.dd_site), + }; + + let mut proxy_aggregator = proxy_aggregator.lock().await; + proxy_aggregator.add(proxy_request); + + Response::builder() + .status(200) + .body(hyper_migration::Body::from("Acknowledged profiling request")) + .map_err(|e| Box::new(e) as Box) + } + fn info_handler(dd_dogstatsd_port: u16) -> http::Result { let response_json = json!( { "endpoints": [ TRACE_ENDPOINT_PATH, STATS_ENDPOINT_PATH, - INFO_ENDPOINT_PATH + INFO_ENDPOINT_PATH, + PROFILING_ENDPOINT_PATH ], "client_drop_p0s": true, "config": { @@ -223,4 +284,5 @@ impl MiniAgent { .status(200) .body(hyper_migration::Body::from(response_json.to_string())) } + } diff --git a/crates/datadog-trace-agent/src/proxy_aggregator.rs b/crates/datadog-trace-agent/src/proxy_aggregator.rs new file mode 100644 index 00000000..bc6865e3 --- /dev/null +++ b/crates/datadog-trace-agent/src/proxy_aggregator.rs @@ -0,0 +1,38 @@ +use bytes::Bytes; // TODO: Do we use bytes? +use reqwest::header::HeaderMap; // TODO: Do we use reqwest? + +pub struct ProxyRequest { + pub headers: HeaderMap, + pub body: Bytes, + pub target_url: String, +} + +/// Takes in individual proxy requests and aggregates them into batches to be flushed to Datadog. +pub struct Aggregator { + queue: Vec, +} + +impl Default for Aggregator { + fn default() -> Self { + Aggregator { + queue: Vec::with_capacity(128), // arbitrary capacity for request queue + } + } +} + +impl Aggregator { + /// Takes in an individual proxy request. + pub fn add(&mut self, request: ProxyRequest) { + self.queue.push(request); + } + + /// Returns a batch of proxy requests. + pub fn get_batch(&mut self) -> Vec { + std::mem::take(&mut self.queue) + } + + /// Flush the queue. + pub fn clear(&mut self) { + self.queue.clear(); + } +} \ No newline at end of file From 49fa6d3b4b5cd8057e070aab56995bf0aedf14f0 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Wed, 15 Oct 2025 14:43:48 -0400 Subject: [PATCH 02/33] Send proxy payload through mpsc channel to then get aggregated and flushed in proxy flusher --- Cargo.lock | 1117 +++++++---------- crates/datadog-serverless-compat/src/main.rs | 11 +- crates/datadog-trace-agent/Cargo.toml | 1 + crates/datadog-trace-agent/src/config.rs | 12 +- crates/datadog-trace-agent/src/http_utils.rs | 16 + crates/datadog-trace-agent/src/lib.rs | 3 +- crates/datadog-trace-agent/src/mini_agent.rs | 70 +- .../src/proxy_aggregator.rs | 13 +- .../datadog-trace-agent/src/proxy_flusher.rs | 240 ++++ .../{aggregator.rs => trace_aggregator.rs} | 0 .../datadog-trace-agent/src/trace_flusher.rs | 2 +- .../src/trace_processor.rs | 6 + 12 files changed, 819 insertions(+), 672 deletions(-) create mode 100644 crates/datadog-trace-agent/src/proxy_flusher.rs rename crates/datadog-trace-agent/src/{aggregator.rs => trace_aggregator.rs} (100%) diff --git a/Cargo.lock b/Cargo.lock index 98a17f99..dd8c38c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,47 +2,38 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy 0.7.35", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] [[package]] name = "anyhow" -version = "1.0.97" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "assert-json-diff" @@ -56,9 +47,9 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.4.0" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" dependencies = [ "event-listener", "event-listener-strategy", @@ -77,13 +68,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.88" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -94,15 +85,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-lc-fips-sys" -version = "0.13.5" +version = "0.13.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d9c2e952a1f57e8cbc78b058a968639e70c4ce8b9c0a5e6363d4e5670eed795" +checksum = "57900537c00a0565a35b63c4c281b372edfc9744b072fd4a3b414350a8f5ed48" dependencies = [ "bindgen", "cc", @@ -114,9 +105,9 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.13.0" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b756939cb2f8dc900aa6dcd505e6e2428e9cae7ff7b028c49e3946efa70878" +checksum = "6a88aab2464f1f25453baa7a07c84c5b7684e274054ba06817f382357f77a288" dependencies = [ "aws-lc-fips-sys", "aws-lc-sys", @@ -125,38 +116,16 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.28.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f7720b74ed28ca77f90769a71fd8c637a0137f6fae4ae947e1050229cff57f" +checksum = "b45afffdee1e7c9126814751f88dddc747f41d91da16c9551a0f1e8a11e788a1" dependencies = [ - "bindgen", "cc", "cmake", "dunce", "fs_extra", ] -[[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -165,25 +134,22 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bindgen" -version = "0.69.5" +version = "0.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" dependencies = [ "bitflags", "cexpr", "clang-sys", - "itertools 0.12.1", - "lazy_static", - "lazycell", + "itertools 0.13.0", "log", "prettyplease", "proc-macro2", "quote", "regex", - "rustc-hash 1.1.0", + "rustc-hash", "shlex", - "syn 2.0.100", - "which", + "syn 2.0.111", ] [[package]] @@ -203,9 +169,9 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "block-buffer" @@ -218,9 +184,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "byteorder" @@ -230,20 +196,20 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" dependencies = [ "serde", ] [[package]] name = "camino" -version = "1.1.9" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -271,10 +237,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.16" +version = "1.2.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -291,9 +258,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" @@ -314,9 +281,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.54" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" +checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" dependencies = [ "cc", ] @@ -332,9 +299,9 @@ dependencies = [ [[package]] name = "const_format" -version = "0.2.34" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" dependencies = [ "const_format_proc_macros", ] @@ -362,9 +329,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" dependencies = [ "core-foundation-sys", "libc", @@ -387,9 +354,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] @@ -402,9 +369,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "typenum", @@ -468,6 +435,7 @@ dependencies = [ "anyhow", "async-trait", "bytes", + "datadog-fips", "duplicate", "http-body-util", "hyper", @@ -515,7 +483,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", "unicode-xid", ] @@ -537,7 +505,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -549,7 +517,7 @@ dependencies = [ "ddsketch-agent", "derive_more", "fnv", - "hashbrown 0.15.2", + "hashbrown 0.15.5", "mockito", "proptest", "protobuf", @@ -606,19 +574,19 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "event-listener" -version = "5.4.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" dependencies = [ "concurrent-queue", "parking", @@ -641,6 +609,12 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "find-msvc-tools" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" + [[package]] name = "fixedbitset" version = "0.5.7" @@ -649,9 +623,9 @@ checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "flate2" -version = "1.1.1" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" +checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" dependencies = [ "crc32fast", "miniz_oxide", @@ -689,9 +663,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] @@ -758,7 +732,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -809,48 +783,42 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "js-sys", "libc", "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "wasip2", "wasm-bindgen", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "glob" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" [[package]] name = "h2" -version = "0.4.8" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" dependencies = [ "atomic-waker", "bytes", @@ -873,23 +841,23 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" [[package]] name = "hashbrown" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "headers" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9" +checksum = "b3314d5adb5d94bcdf56771f2e50dbbc80bb4bdf88967526706205ac9eff24eb" dependencies = [ - "base64 0.21.7", + "base64", "bytes", "headers-core", "http", @@ -927,21 +895,20 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "home" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "http" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ "bytes", - "fnv", "itoa", ] @@ -982,14 +949,14 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "httpmock" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cccf7d3f1b6ee94515933ed2d24615bc8aa2a68c3858e318422f10f538888f2" +checksum = "511f510e9b1888d67f10bab4397f8b019d2a9b249a2c10acbce2d705b1b32e26" dependencies = [ "assert-json-diff", "async-object-pool", "async-trait", - "base64 0.22.1", + "base64", "bytes", "crossbeam-utils", "form_urlencoded", @@ -1008,7 +975,7 @@ dependencies = [ "similar", "stringmetrics", "tabwriter", - "thiserror 2.0.12", + "thiserror 2.0.17", "tokio", "tracing", "url", @@ -1016,13 +983,14 @@ dependencies = [ [[package]] name = "hyper" -version = "1.6.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", + "futures-core", "h2", "http", "http-body", @@ -1030,6 +998,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", + "pin-utils", "smallvec", "tokio", "want", @@ -1052,16 +1021,15 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots 0.26.8", + "webpki-roots 0.26.11", ] [[package]] name = "hyper-rustls" -version = "0.27.5" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "futures-util", "http", "hyper", "hyper-util", @@ -1071,7 +1039,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots 0.26.8", + "webpki-roots 1.0.4", ] [[package]] @@ -1092,11 +1060,11 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "futures-channel", "futures-core", @@ -1108,7 +1076,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.1", + "socket2", "system-configuration", "tokio", "tower-service", @@ -1118,21 +1086,22 @@ dependencies = [ [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ "displaydoc", "litemap", @@ -1141,104 +1110,66 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ - "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ - "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", + "icu_locale_core", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -1247,9 +1178,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -1257,12 +1188,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "equivalent", - "hashbrown 0.16.0", + "hashbrown 0.16.1", ] [[package]] @@ -1283,9 +1214,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -1307,18 +1238,19 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ + "getrandom 0.3.4", "libc", ] [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -1330,12 +1262,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.178" @@ -1453,12 +1379,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -1469,46 +1395,51 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" -version = "0.7.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.26" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lru-slab" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" [[package]] name = "matchers" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" dependencies = [ - "regex-automata 0.1.10", + "regex-automata", ] [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "mime" @@ -1524,40 +1455,42 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", + "simd-adler32", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi", + "windows-sys 0.61.2", ] [[package]] name = "mockito" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7760e0e418d9b7e5777c0374009ca4c93861b9066f18cb334a20ce50ab63aa48" +checksum = "7e0603425789b4a70fcc4ac4f5a46a566c116ee3e2a6b768dc623f7719c611de" dependencies = [ "assert-json-diff", "bytes", - "futures-util", + "futures-core", "http", "http-body", "http-body-util", "hyper", "hyper-util", "log", - "rand 0.9.0", + "pin-project-lite", + "rand 0.9.2", "regex", "serde_json", "serde_urlencoded", @@ -1567,9 +1500,9 @@ dependencies = [ [[package]] name = "multimap" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" [[package]] name = "native-tls" @@ -1612,12 +1545,11 @@ dependencies = [ [[package]] name = "nu-ansi-term" -version = "0.46.0" +version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "overload", - "winapi", + "windows-sys 0.61.2", ] [[package]] @@ -1629,20 +1561,11 @@ dependencies = [ "autocfg", ] -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "openssl" @@ -1667,7 +1590,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -1697,12 +1620,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - [[package]] name = "parking" version = "2.2.1" @@ -1711,9 +1628,9 @@ checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", @@ -1721,15 +1638,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -1749,9 +1666,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "petgraph" @@ -1780,7 +1697,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -1801,23 +1718,32 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + [[package]] name = "ppv-lite86" version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.23", + "zerocopy", ] [[package]] name = "prettyplease" -version = "0.2.31" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -1846,28 +1772,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" +checksum = "bee689443a2bd0a16ab0348b52ee43e3b2d1b1f931c8aa5c9f8de4c86fbe8c40" dependencies = [ "bit-set", "bit-vec", "bitflags", - "lazy_static", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "rand_xorshift", - "regex-syntax 0.8.5", + "regex-syntax", "rusty-fork", "tempfile", "unarray", @@ -1899,7 +1824,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.100", + "syn 2.0.111", "tempfile", ] @@ -1913,7 +1838,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -1985,19 +1910,19 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.7" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3bd15a6f2967aef83887dcb9fec0014580467e33720d073560cf015a5683012" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ "bytes", "cfg_aliases", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.1.1", + "rustc-hash", "rustls", - "socket2 0.5.8", - "thiserror 2.0.12", + "socket2", + "thiserror 2.0.17", "tokio", "tracing", "web-time", @@ -2005,19 +1930,20 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.10" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ "bytes", - "getrandom 0.3.2", - "rand 0.9.0", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.2", "ring", - "rustc-hash 2.1.1", + "rustc-hash", "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.12", + "thiserror 2.0.17", "tinyvec", "tracing", "web-time", @@ -2025,32 +1951,32 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.10" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.5.8", + "socket2", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ "proc-macro2", ] [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" @@ -2065,13 +1991,12 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", - "zerocopy 0.8.23", ] [[package]] @@ -2100,7 +2025,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] @@ -2109,70 +2034,55 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.2", + "getrandom 0.3.4", ] [[package]] name = "rand_xorshift" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" dependencies = [ - "rand_core 0.6.4", + "rand_core 0.9.3", ] [[package]] name = "redox_syscall" -version = "0.5.10" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "regex-automata", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "reqwest" @@ -2180,7 +2090,7 @@ version = "0.12.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b4c14b2d9afca6a60277086b0cc6a6ae0b568f6f7916c943a8cdc79f8be240f" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "encoding_rs", "futures-core", @@ -2226,7 +2136,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.16", "libc", "untrusted", "windows-sys 0.52.0", @@ -2264,18 +2174,6 @@ dependencies = [ "rmp", ] -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.1" @@ -2297,22 +2195,22 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys 0.9.3", - "windows-sys 0.59.0", + "linux-raw-sys 0.11.0", + "windows-sys 0.61.2", ] [[package]] name = "rustls" -version = "0.23.25" +version = "0.23.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" +checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" dependencies = [ "aws-lc-rs", "once_cell", @@ -2325,30 +2223,31 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +checksum = "9980d917ebb0c0536119ba501e90834767bffc3d60641457fd84a1f3fd337923" dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.2.0", + "security-framework 3.5.1", ] [[package]] name = "rustls-pki-types" -version = "1.11.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" +checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" dependencies = [ "web-time", + "zeroize", ] [[package]] name = "rustls-webpki" -version = "0.103.0" +version = "0.103.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa4eeac2588ffff23e9d7a7e9b3f971c5fb5b7ebc9452745e0c232c64f83b2f" +checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" dependencies = [ "aws-lc-rs", "ring", @@ -2358,15 +2257,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "rusty-fork" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" dependencies = [ "fnv", "quick-error", @@ -2382,11 +2281,11 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "schannel" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -2410,12 +2309,12 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.2.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" dependencies = [ "bitflags", - "core-foundation 0.10.0", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -2423,9 +2322,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.14.0" +version = "2.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -2433,52 +2332,65 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" dependencies = [ "serde", + "serde_core", ] [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ + "serde_core", "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.17" +version = "0.11.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" dependencies = [ "serde", + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] @@ -2525,7 +2437,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -2556,13 +2468,19 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + [[package]] name = "similar" version = "2.7.0" @@ -2571,28 +2489,15 @@ checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] name = "slab" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" - -[[package]] -name = "socket2" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" @@ -2606,9 +2511,9 @@ dependencies = [ [[package]] name = "stable_deref_trait" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "static_assertions" @@ -2640,9 +2545,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.100" +version = "2.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" dependencies = [ "proc-macro2", "quote", @@ -2660,13 +2565,13 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -2701,15 +2606,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.1" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand", - "getrandom 0.3.2", + "getrandom 0.3.4", "once_cell", - "rustix 1.0.3", - "windows-sys 0.59.0", + "rustix 1.1.2", + "windows-sys 0.61.2", ] [[package]] @@ -2723,11 +2628,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.12" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl 2.0.12", + "thiserror-impl 2.0.17", ] [[package]] @@ -2738,35 +2643,34 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] name = "thiserror-impl" -version = "2.0.12" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" dependencies = [ "displaydoc", "zerovec", @@ -2774,9 +2678,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -2789,30 +2693,29 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.1" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ - "backtrace", "bytes", "libc", "mio", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.8", + "socket2", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -2827,9 +2730,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ "rustls", "tokio", @@ -2848,9 +2751,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.14" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" +checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" dependencies = [ "bytes", "futures-core", @@ -2866,7 +2769,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9" dependencies = [ "async-trait", - "base64 0.22.1", + "base64", "bytes", "http", "http-body", @@ -2891,7 +2794,7 @@ dependencies = [ "prost-build", "prost-types", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -2941,9 +2844,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "log", "pin-project-lite", @@ -2953,20 +2856,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", "valuable", @@ -2985,14 +2888,14 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.19" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" dependencies = [ "matchers", "nu-ansi-term", "once_cell", - "regex", + "regex-automata", "sharded-slab", "smallvec", "thread_local", @@ -3019,7 +2922,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -3030,9 +2933,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "unarray" @@ -3042,15 +2945,15 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-width" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "unicode-xid" @@ -3066,13 +2969,14 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -3093,12 +2997,6 @@ dependencies = [ "parking_lot", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -3143,50 +3041,37 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" +name = "wasip2" +version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ - "wit-bindgen-rt", + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.100", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" dependencies = [ "cfg-if", "js-sys", @@ -3197,9 +3082,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3207,31 +3092,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ + "bumpalo", "proc-macro2", "quote", - "syn 2.0.100", - "wasm-bindgen-backend", + "syn 2.0.111", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" dependencies = [ "js-sys", "wasm-bindgen", @@ -3249,11 +3134,11 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.8" +version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "rustls-pki-types", + "webpki-roots 1.0.4", ] [[package]] @@ -3277,34 +3162,6 @@ dependencies = [ "rustix 0.38.44", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - [[package]] name = "windows-link" version = "0.2.1" @@ -3313,31 +3170,31 @@ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-registry" -version = "0.5.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ - "windows-link 0.1.3", + "windows-link", "windows-result", "windows-strings", ] [[package]] name = "windows-result" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] name = "windows-strings" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] @@ -3367,6 +3224,15 @@ dependencies = [ "windows-targets 0.53.5", ] +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -3389,15 +3255,15 @@ version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link 0.2.1", - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -3408,9 +3274,9 @@ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" @@ -3420,9 +3286,9 @@ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" @@ -3432,9 +3298,9 @@ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" [[package]] name = "windows_i686_gnullvm" @@ -3444,9 +3310,9 @@ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" @@ -3456,9 +3322,9 @@ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" @@ -3468,9 +3334,9 @@ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" @@ -3480,9 +3346,9 @@ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" @@ -3492,38 +3358,28 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - -[[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags", -] +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] -name = "write16" -version = "1.0.0" +name = "wit-bindgen" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" dependencies = [ - "serde", "stable_deref_trait", "yoke-derive", "zerofrom", @@ -3531,54 +3387,34 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", "synstructure", ] [[package]] name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" -dependencies = [ - "zerocopy-derive 0.8.23", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", + "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.23" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -3598,21 +3434,32 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", "synstructure", ] [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" dependencies = [ "yoke", "zerofrom", @@ -3621,13 +3468,13 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.111", ] [[package]] @@ -3641,18 +3488,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.2.3" +version = "7.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.14+zstd.1.5.7" +version = "2.0.16+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" dependencies = [ "cc", "pkg-config", diff --git a/crates/datadog-serverless-compat/src/main.rs b/crates/datadog-serverless-compat/src/main.rs index 04e995a3..5660f3b5 100644 --- a/crates/datadog-serverless-compat/src/main.rs +++ b/crates/datadog-serverless-compat/src/main.rs @@ -17,10 +17,12 @@ use tracing_subscriber::EnvFilter; use zstd::zstd_safe::CompressionLevel; use datadog_trace_agent::{ - aggregator::TraceAggregator, + trace_aggregator::TraceAggregator, config, env_verifier, mini_agent, stats_flusher, stats_processor, trace_flusher::{self, TraceFlusher}, trace_processor, + proxy_aggregator, + proxy_flusher, }; use libdd_trace_utils::{config_utils::read_cloud_env, trace_utils::EnvironmentType}; @@ -124,6 +126,12 @@ pub async fn main() { Arc::clone(&config), )); + let proxy_aggregator = Arc::new(TokioMutex::new(proxy_aggregator::ProxyAggregator::default())); + let proxy_flusher = Arc::new(proxy_flusher::ProxyFlusher::new( + proxy_aggregator, + Arc::clone(&config), + )); + let mini_agent = Box::new(mini_agent::MiniAgent { config: Arc::clone(&config), env_verifier, @@ -131,6 +139,7 @@ pub async fn main() { trace_flusher, stats_processor, stats_flusher, + proxy_flusher, }); tokio::spawn(async move { diff --git a/crates/datadog-trace-agent/Cargo.toml b/crates/datadog-trace-agent/Cargo.toml index 6d4870de..f15d12c4 100644 --- a/crates/datadog-trace-agent/Cargo.toml +++ b/crates/datadog-trace-agent/Cargo.toml @@ -26,6 +26,7 @@ libdd-trace-protobuf = { git = "https://github.com/DataDog/libdatadog", rev = "4 libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "435107c245112397914935c0f7148a18b91cafc6", features = [ "mini_agent", ] } +datadog-fips = { path = "../datadog-fips", default-features = false } reqwest = { version = "0.12.23", features = ["json"] } bytes = "1.10.1" diff --git a/crates/datadog-trace-agent/src/config.rs b/crates/datadog-trace-agent/src/config.rs index e6ac5408..9472d417 100644 --- a/crates/datadog-trace-agent/src/config.rs +++ b/crates/datadog-trace-agent/src/config.rs @@ -11,7 +11,7 @@ use std::sync::OnceLock; use libdd_trace_obfuscation::obfuscation_config; use libdd_trace_utils::config_utils::{ read_cloud_env, trace_intake_url, trace_intake_url_prefixed, trace_stats_url, - trace_stats_url_prefixed, + trace_stats_url_prefixed }; use libdd_trace_utils::trace_utils; @@ -86,6 +86,9 @@ pub struct Config { pub trace_flush_interval: u64, pub trace_intake: Endpoint, pub trace_stats_intake: Endpoint, + /// how often to flush proxy requests, in seconds + pub proxy_flush_interval: u64, + pub proxy_intake: Endpoint, /// timeout for environment verification, in milliseconds pub verify_env_timeout: u64, pub proxy_url: Option, @@ -111,6 +114,7 @@ impl Config { // trace stats to) let mut trace_intake_url = trace_intake_url(&dd_site); let mut trace_stats_intake_url = trace_stats_url(&dd_site); + let proxy_intake_url = format!("https://intake.profile.{}/api/v2/profile", dd_site); // DD_APM_DD_URL env var will primarily be used for integration tests // overrides the entire trace/trace stats intake url prefix @@ -139,6 +143,7 @@ impl Config { max_request_content_length: 10 * 1024 * 1024, // 10MB in Bytes trace_flush_interval: 3, stats_flush_interval: 3, + proxy_flush_interval: 3, verify_env_timeout: 100, dd_dogstatsd_port, dd_site, @@ -149,6 +154,11 @@ impl Config { }, trace_stats_intake: Endpoint { url: hyper::Uri::from_str(&trace_stats_intake_url).unwrap(), + api_key: Some(api_key.clone()), + ..Default::default() + }, + proxy_intake: Endpoint { + url: hyper::Uri::from_str(&proxy_intake_url).unwrap(), api_key: Some(api_key), ..Default::default() }, diff --git a/crates/datadog-trace-agent/src/http_utils.rs b/crates/datadog-trace-agent/src/http_utils.rs index 241204ad..0bbc26ba 100644 --- a/crates/datadog-trace-agent/src/http_utils.rs +++ b/crates/datadog-trace-agent/src/http_utils.rs @@ -9,6 +9,9 @@ use hyper::{ use libdd_common::hyper_migration; use serde_json::json; use tracing::{debug, error}; +use datadog_fips::reqwest_adapter::create_reqwest_client_builder; +use core::time::Duration; +use std::error::Error; /// Does two things: /// 1. Logs the given message. A success status code (within 200-299) will cause an info log to be @@ -111,6 +114,19 @@ pub fn verify_request_content_length( None } +/// Builds a reqwest client with optional proxy configuration and timeout. +/// Uses FIPS-compliant TLS when the fips feature is enabled. +pub fn build_client( + proxy_url: Option<&str>, + timeout: Duration, +) -> Result> { + let mut builder = create_reqwest_client_builder()?.timeout(timeout); + if let Some(proxy) = proxy_url { + builder = builder.proxy(reqwest::Proxy::all(proxy)?); + } + Ok(builder.build()?) +} + #[cfg(test)] mod tests { use http_body_util::BodyExt; diff --git a/crates/datadog-trace-agent/src/lib.rs b/crates/datadog-trace-agent/src/lib.rs index 5629d564..bee80ddd 100644 --- a/crates/datadog-trace-agent/src/lib.rs +++ b/crates/datadog-trace-agent/src/lib.rs @@ -7,12 +7,13 @@ #![cfg_attr(not(test), deny(clippy::todo))] #![cfg_attr(not(test), deny(clippy::unimplemented))] -pub mod aggregator; +pub mod trace_aggregator; pub mod config; pub mod env_verifier; pub mod http_utils; pub mod mini_agent; pub mod proxy_aggregator; +pub mod proxy_flusher; pub mod stats_flusher; pub mod stats_processor; pub mod trace_flusher; diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index b3c8f4f8..916e02a2 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -10,14 +10,11 @@ use std::io; use std::net::SocketAddr; use std::sync::Arc; use std::time::Instant; -use tokio::sync::{ - Mutex, - mpsc::{self, Receiver, Sender}, -}; +use tokio::sync::mpsc::{self, Receiver, Sender}; use tracing::{debug, error}; -use crate::http_utils::log_and_create_http_response; -use crate::{config, env_verifier, stats_flusher, stats_processor, trace_flusher, trace_processor}; +use crate::http_utils::{verify_request_content_length, log_and_create_http_response}; +use crate::{config, env_verifier, stats_flusher, stats_processor, trace_flusher, trace_processor, proxy_aggregator::ProxyRequest, proxy_flusher}; use libdd_trace_protobuf::pb; use libdd_trace_utils::trace_utils; use libdd_trace_utils::trace_utils::SendData; @@ -29,6 +26,7 @@ const INFO_ENDPOINT_PATH: &str = "/info"; const PROFILING_ENDPOINT_PATH: &str = "/profiling/v1/input"; const TRACER_PAYLOAD_CHANNEL_BUFFER_SIZE: usize = 10; const STATS_PAYLOAD_CHANNEL_BUFFER_SIZE: usize = 10; +const PROXY_PAYLOAD_CHANNEL_BUFFER_SIZE: usize = 10; pub struct MiniAgent { pub config: Arc, @@ -37,7 +35,7 @@ pub struct MiniAgent { pub stats_processor: Arc, pub stats_flusher: Arc, pub env_verifier: Arc, - pub proxy_aggregator: Arc>, + pub proxy_flusher: Arc, } impl MiniAgent { @@ -87,18 +85,23 @@ impl MiniAgent { .start_stats_flusher(stats_config, stats_rx) .await; }); + // channels to send processed profiling requests to our proxy flusher. + let (proxy_tx, proxy_rx): ( + Sender, + Receiver, + ) = mpsc::channel(PROXY_PAYLOAD_CHANNEL_BUFFER_SIZE); // start our proxy flusher for profiling requests - let proxy_aggregator_for_flusher = self.proxy_aggregator.clone(); + let proxy_flusher = self.proxy_flusher.clone(); tokio::spawn(async move { - let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(10)); + let proxy_flusher = proxy_flusher.clone(); + proxy_flusher.start_proxy_flusher(proxy_rx).await; }); // setup our hyper http server, where the endpoint_handler handles incoming requests let trace_processor = self.trace_processor.clone(); let stats_processor = self.stats_processor.clone(); let endpoint_config = self.config.clone(); - let proxy_aggregator = self.proxy_aggregator.clone(); let service = service_fn(move |req| { // called for each http request @@ -108,7 +111,8 @@ impl MiniAgent { let stats_tx = stats_tx.clone(); let endpoint_config = endpoint_config.clone(); let mini_agent_metadata = Arc::clone(&mini_agent_metadata); - let proxy_aggregator = proxy_aggregator.clone(); + + let proxy_tx = proxy_tx.clone(); MiniAgent::trace_endpoint_handler( endpoint_config, @@ -118,7 +122,7 @@ impl MiniAgent { stats_processor.clone(), stats_tx.clone(), Arc::clone(&mini_agent_metadata), - proxy_aggregator, + proxy_tx.clone(), ) }); @@ -182,7 +186,7 @@ impl MiniAgent { stats_processor: Arc, stats_tx: Sender, mini_agent_metadata: Arc, - proxy_aggregator: Arc>, + proxy_tx: Sender, ) -> http::Result { match (req.method(), req.uri().path()) { (&Method::PUT | &Method::POST, TRACE_ENDPOINT_PATH) => { @@ -207,7 +211,7 @@ impl MiniAgent { } } (&Method::POST, PROFILING_ENDPOINT_PATH) => { - match Self::profiling_proxy_handler(config, req, proxy_aggregator).await { + match Self::profiling_proxy_handler(config, req, proxy_tx).await { Ok(res) => Ok(res), Err(err) => log_and_create_http_response( &format!("Error processing profiling request: {err}"), @@ -233,36 +237,48 @@ impl MiniAgent { async fn profiling_proxy_handler( config: Arc, request: hyper_migration::HttpRequest, - proxy_aggregator: Arc>, - ) -> Result> { + proxy_tx: Sender, + ) -> http::Result { debug!("Trace Agent | Proxied request for profiling"); // Extract headers and body let (parts, body) = request.into_parts(); - if let Some(response) = http_utils::verify_request_content_length( + if let Some(response) = verify_request_content_length( &parts.headers, config.max_request_content_length, "Error processing profiling request", ) { - return response.map_err(|e| Box::new(e) as Box); + return response; } - let body_bytes = body.collect().await?.to_bytes(); + let body_bytes = match body.collect().await { + Ok(collected) => collected.to_bytes(), + Err(e) => { + return log_and_create_http_response( + &format!("Error reading profiling request body: {e}"), + StatusCode::BAD_REQUEST, + ); + } + }; // Create proxy request let proxy_request = ProxyRequest { headers: parts.headers, body: body_bytes, - target_url: format!("https://intake.profile.{}/api/v2/profile", config.dd_site), + target_url: config.proxy_intake.url.to_string(), }; - let mut proxy_aggregator = proxy_aggregator.lock().await; - proxy_aggregator.add(proxy_request); - - Response::builder() - .status(200) - .body(hyper_migration::Body::from("Acknowledged profiling request")) - .map_err(|e| Box::new(e) as Box) + // Send to channel - flusher will aggregate and send + match proxy_tx.send(proxy_request).await { + Ok(_) => log_and_create_http_response( + "Successfully buffered profiling request to be flushed", + StatusCode::OK, + ), + Err(err) => log_and_create_http_response( + &format!("Error sending profiling request to the proxy flusher: {err}"), + StatusCode::INTERNAL_SERVER_ERROR, + ), + } } fn info_handler(dd_dogstatsd_port: u16) -> http::Result { diff --git a/crates/datadog-trace-agent/src/proxy_aggregator.rs b/crates/datadog-trace-agent/src/proxy_aggregator.rs index bc6865e3..e50ed17c 100644 --- a/crates/datadog-trace-agent/src/proxy_aggregator.rs +++ b/crates/datadog-trace-agent/src/proxy_aggregator.rs @@ -1,6 +1,7 @@ -use bytes::Bytes; // TODO: Do we use bytes? -use reqwest::header::HeaderMap; // TODO: Do we use reqwest? +use bytes::Bytes; +use reqwest::header::HeaderMap; +#[derive(Clone)] pub struct ProxyRequest { pub headers: HeaderMap, pub body: Bytes, @@ -8,19 +9,19 @@ pub struct ProxyRequest { } /// Takes in individual proxy requests and aggregates them into batches to be flushed to Datadog. -pub struct Aggregator { +pub struct ProxyAggregator { queue: Vec, } -impl Default for Aggregator { +impl Default for ProxyAggregator { fn default() -> Self { - Aggregator { + ProxyAggregator { queue: Vec::with_capacity(128), // arbitrary capacity for request queue } } } -impl Aggregator { +impl ProxyAggregator { /// Takes in an individual proxy request. pub fn add(&mut self, request: ProxyRequest) { self.queue.push(request); diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs new file mode 100644 index 00000000..94c0255d --- /dev/null +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -0,0 +1,240 @@ +// Copyright 2023-Present Datadog, Inc. https://www.datadoghq.com/ +// SPDX-License-Identifier: Apache-2.0 +use std::{sync::Arc, time}; +use tokio::sync::{Mutex, OnceCell, mpsc::Receiver}; +use tracing::{debug, error}; +use reqwest::header::HeaderMap; + +use crate::config::Config; +use crate::proxy_aggregator::{ProxyAggregator, ProxyRequest}; +use crate::http_utils::build_client; +use core::time::Duration; + +pub struct ProxyFlusher { + // Starts a proxy flusher that listens for proxy payloads + pub aggregator: Arc>, + pub config: Arc, + client: reqwest::Client, + headers: OnceCell, +} + +impl ProxyFlusher { + pub fn new(aggregator: Arc>, config: Arc) -> Self { + // let client = (|| -> Result> { + // let mut builder = create_reqwest_client_builder()?.timeout(Duration::from_secs(30)); + // if let Some(proxy) = &config.proxy_url { + // builder = builder.proxy(reqwest::Proxy::all(proxy)?); + // } + // Ok(builder.build()?) + // })() + // .unwrap_or_else(|e| { + // error!("Failed to create HTTP client: {}, using default", e); + // reqwest::Client::new() + // }); + let client = build_client(config.proxy_url.as_deref(), Duration::from_secs(30)) + .unwrap_or_else(|e| { + error!( + "Unable to parse proxy configuration: {}, no proxy will be used", + e + ); + reqwest::Client::new() + }); + ProxyFlusher { aggregator, config, client, headers: OnceCell::new() } + } + + async fn get_headers(&self, api_key: &str) -> &HeaderMap { + self.headers + .get_or_init(move || async move { + let mut headers = HeaderMap::new(); + headers.insert( + "DD-API-KEY", + api_key.parse().expect("Failed to parse API key header"), + ); + headers + }) + .await + } + + pub async fn start_proxy_flusher(&self, mut rx: Receiver) { + let aggregator = Arc::clone(&self.aggregator); + tokio::spawn(async move { + while let Some(proxy_payload) = rx.recv().await { + let mut guard = aggregator.lock().await; + guard.add(proxy_payload); + } + }); + + loop { + tokio::time::sleep(time::Duration::from_secs(self.config.proxy_flush_interval)).await; + self.flush(None).await; + } + } + + /// Flushes proxy requests by getting every available batch on the aggregator. + /// If `failed_requests` is provided, it will attempt to send those instead of fetching new requests. + /// Returns any requests that failed to send and should be retried. + async fn flush(&self, failed_requests: Option>) -> Option> { + let mut failed_batch: Option> = None; + + if let Some(requests) = failed_requests { + // If we have requests from a previous failed attempt, try to send those first + if !requests.is_empty() { + debug!("Proxy Flusher | Retrying {} failed requests", requests.len()); + let retry_result = self.send_requests(requests).await; + if retry_result.is_some() { + // Still failed, return to retry later + return retry_result; + } + } + } + + // Process new requests from the aggregator + let mut guard = self.aggregator.lock().await; + let mut requests = guard.get_batch(); + while !requests.is_empty() { + if let Some(failed) = self.send_requests(requests).await { + // Keep track of the failed batch + failed_batch = Some(failed); + // Stop processing more batches if we have a failure + break; + } + + requests = guard.get_batch(); + } + failed_batch + } + + // If we have requests from a previous failed attempt, try to send those first + // if failed_requests.as_ref().is_some_and(|r| !r.is_empty()) { + // let retries = failed_requests.unwrap_or_default(); + // debug!("Proxy Flusher | Retrying {} failed requests", retries.len()); + // requests = retries; + // } else { + // let mut aggregator = self.aggregator.lock().await; + // for pr in aggregator.get_batch() { + // requests.push(self.create_request(pr, self.config.proxy_intake.api_key.as_ref().unwrap()).await); + // } + // for request in requests { + // if let Some(failed) = Self::send_request(request).await { + // failed_batch = Some(failed); + // // Put requests back into the aggregator? + // break; + // } + // } + // } + // failed_batch + + async fn create_request( + &self, + request: ProxyRequest, + api_key: &str, + ) -> reqwest::RequestBuilder { + let mut headers = request.headers.clone(); + + // Remove headers that are not needed for the proxy request + headers.remove("host"); + headers.remove("content-length"); + + headers.extend(self.get_headers(api_key).await.clone()); + + // TODO: Figure out what client to use / how data should be sent + self.client + .post(&request.target_url) + .headers(headers) + .timeout(std::time::Duration::from_secs(30)) + .body(request.body) + } + + async fn send_requests(&self, requests: Vec) -> Option> { + if requests.is_empty() { + return None; + } + debug!("Proxy Flusher | Attempting to send {} requests", requests.len()); + + let mut failed_requests = Vec::new(); + + for request_payload in requests { + // Clone the payload before creating the request builder (which consumes body) + let cloned_payload = request_payload.clone(); + let request = self.create_request(request_payload, self.config.proxy_intake.api_key.as_ref().unwrap()).await; + let time = std::time::Instant::now(); + match request.send().await { + Ok(r) => { + let elapsed = time.elapsed(); + let url = r.url().to_string(); + let status = r.status(); + let body = r.text().await; + if status == 202 || status == 200 { + debug!("Proxy Flusher | Successfully sent request {url} in {} ms", elapsed.as_millis()); + } else { + error!("Proxy Flusher | Request failed with status {status}: {body:?}"); + failed_requests.push(cloned_payload); + } + } + Err(e) => { + error!("Proxy Flusher | Failed to send request: {e:?}"); + failed_requests.push(cloned_payload); + } + } + } + + if failed_requests.is_empty() { + None + } else { + Some(failed_requests) + } + } + + // /// Given a `reqwest::RequestBuilder`, send the request and handle retries. + // async fn send_request(request: reqwest::RequestBuilder) -> Result<(), Box> { + // debug!("Proxy Flusher | Attempting to send request"); + // let mut attempts = 0; + + // loop { + // attempts += 1; + + // let Some(cloned_request) = request.try_clone() else { + // return Err(Box::new(std::io::Error::new( + // std::io::ErrorKind::Other, + // "can't clone proxy request", + // ))); + // }; + + // let time = std::time::Instant::now(); + // let response = cloned_request.send().await; + // let elapsed = time.elapsed(); + + // match response { + // Ok(r) => { + // let url = r.url().to_string(); + // let status = r.status(); + // let body = r.text().await; + // if status == 202 || status == 200 { + // debug!( + // "Proxy Flusher | Successfully sent request in {} ms to {url}", + // elapsed.as_millis() + // ); + // } else { + // error!("Proxy Flusher | Request failed with status {status}: {body:?}"); + // } + + // return Ok(()); + // } + // Err(e) => { + // if attempts >= 3 { + // error!( + // "Proxy Flusher | Failed to send request after {} attempts: {:?}", + // attempts, e + // ); + + // return Err(Box::new(FailedProxyRequestError { + // request, + // message: e.to_string(), + // })); + // } + // } + // } + // } + // } +} + diff --git a/crates/datadog-trace-agent/src/aggregator.rs b/crates/datadog-trace-agent/src/trace_aggregator.rs similarity index 100% rename from crates/datadog-trace-agent/src/aggregator.rs rename to crates/datadog-trace-agent/src/trace_aggregator.rs diff --git a/crates/datadog-trace-agent/src/trace_flusher.rs b/crates/datadog-trace-agent/src/trace_flusher.rs index c65fd4b8..64d87bdf 100644 --- a/crates/datadog-trace-agent/src/trace_flusher.rs +++ b/crates/datadog-trace-agent/src/trace_flusher.rs @@ -10,7 +10,7 @@ use libdd_common::{hyper_migration, GenericHttpClient}; use libdd_trace_utils::trace_utils; use libdd_trace_utils::trace_utils::SendData; -use crate::aggregator::TraceAggregator; +use crate::trace_aggregator::TraceAggregator; use crate::config::Config; #[async_trait] diff --git a/crates/datadog-trace-agent/src/trace_processor.rs b/crates/datadog-trace-agent/src/trace_processor.rs index 01e6d3d4..a96e03c9 100644 --- a/crates/datadog-trace-agent/src/trace_processor.rs +++ b/crates/datadog-trace-agent/src/trace_processor.rs @@ -205,6 +205,12 @@ mod tests { os: "linux".to_string(), obfuscation_config: ObfuscationConfig::new().unwrap(), proxy_url: None, + proxy_flush_interval: 3, + proxy_intake: Endpoint { + url: hyper::Uri::from_static("https://proxy.agent.notdog.com/proxy"), + api_key: Some("dummy_api_key".into()), + ..Default::default() + }, tags: Tags::from_env_string("env:test,service:my-service"), } } From 39eab7de19381ffeefe88c58b73634bb0233ad29 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Thu, 16 Oct 2025 17:11:03 -0400 Subject: [PATCH 03/33] Remove aggregator logic, just send payload through channel and then handle forwarding and retries in background task --- crates/datadog-serverless-compat/src/main.rs | 3 - crates/datadog-trace-agent/src/config.rs | 2 +- crates/datadog-trace-agent/src/lib.rs | 1 - crates/datadog-trace-agent/src/mini_agent.rs | 11 +- .../src/proxy_aggregator.rs | 39 ---- .../datadog-trace-agent/src/proxy_flusher.rs | 215 ++++-------------- 6 files changed, 49 insertions(+), 222 deletions(-) delete mode 100644 crates/datadog-trace-agent/src/proxy_aggregator.rs diff --git a/crates/datadog-serverless-compat/src/main.rs b/crates/datadog-serverless-compat/src/main.rs index 5660f3b5..ef3d4a68 100644 --- a/crates/datadog-serverless-compat/src/main.rs +++ b/crates/datadog-serverless-compat/src/main.rs @@ -21,7 +21,6 @@ use datadog_trace_agent::{ config, env_verifier, mini_agent, stats_flusher, stats_processor, trace_flusher::{self, TraceFlusher}, trace_processor, - proxy_aggregator, proxy_flusher, }; @@ -126,9 +125,7 @@ pub async fn main() { Arc::clone(&config), )); - let proxy_aggregator = Arc::new(TokioMutex::new(proxy_aggregator::ProxyAggregator::default())); let proxy_flusher = Arc::new(proxy_flusher::ProxyFlusher::new( - proxy_aggregator, Arc::clone(&config), )); diff --git a/crates/datadog-trace-agent/src/config.rs b/crates/datadog-trace-agent/src/config.rs index 9472d417..f977042e 100644 --- a/crates/datadog-trace-agent/src/config.rs +++ b/crates/datadog-trace-agent/src/config.rs @@ -11,7 +11,7 @@ use std::sync::OnceLock; use libdd_trace_obfuscation::obfuscation_config; use libdd_trace_utils::config_utils::{ read_cloud_env, trace_intake_url, trace_intake_url_prefixed, trace_stats_url, - trace_stats_url_prefixed + trace_stats_url_prefixed, }; use libdd_trace_utils::trace_utils; diff --git a/crates/datadog-trace-agent/src/lib.rs b/crates/datadog-trace-agent/src/lib.rs index bee80ddd..68027c46 100644 --- a/crates/datadog-trace-agent/src/lib.rs +++ b/crates/datadog-trace-agent/src/lib.rs @@ -12,7 +12,6 @@ pub mod config; pub mod env_verifier; pub mod http_utils; pub mod mini_agent; -pub mod proxy_aggregator; pub mod proxy_flusher; pub mod stats_flusher; pub mod stats_processor; diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index 916e02a2..fa49809c 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -14,7 +14,8 @@ use tokio::sync::mpsc::{self, Receiver, Sender}; use tracing::{debug, error}; use crate::http_utils::{verify_request_content_length, log_and_create_http_response}; -use crate::{config, env_verifier, stats_flusher, stats_processor, trace_flusher, trace_processor, proxy_aggregator::ProxyRequest, proxy_flusher}; +use crate::proxy_flusher::{ProxyRequest, ProxyFlusher}; +use crate::{config, env_verifier, stats_flusher, stats_processor, trace_flusher, trace_processor }; use libdd_trace_protobuf::pb; use libdd_trace_utils::trace_utils; use libdd_trace_utils::trace_utils::SendData; @@ -35,7 +36,7 @@ pub struct MiniAgent { pub stats_processor: Arc, pub stats_flusher: Arc, pub env_verifier: Arc, - pub proxy_flusher: Arc, + pub proxy_flusher: Arc, } impl MiniAgent { @@ -85,7 +86,8 @@ impl MiniAgent { .start_stats_flusher(stats_config, stats_rx) .await; }); - // channels to send processed profiling requests to our proxy flusher. + + // channels to send processed profiling requests to our proxy flusher let (proxy_tx, proxy_rx): ( Sender, Receiver, @@ -234,6 +236,7 @@ impl MiniAgent { } } + /// Handles incoming proxy requests for profiling - can be abstracted into a generic proxy handler for other proxy requests in the future async fn profiling_proxy_handler( config: Arc, request: hyper_migration::HttpRequest, @@ -268,7 +271,7 @@ impl MiniAgent { target_url: config.proxy_intake.url.to_string(), }; - // Send to channel - flusher will aggregate and send + // Send to channel match proxy_tx.send(proxy_request).await { Ok(_) => log_and_create_http_response( "Successfully buffered profiling request to be flushed", diff --git a/crates/datadog-trace-agent/src/proxy_aggregator.rs b/crates/datadog-trace-agent/src/proxy_aggregator.rs deleted file mode 100644 index e50ed17c..00000000 --- a/crates/datadog-trace-agent/src/proxy_aggregator.rs +++ /dev/null @@ -1,39 +0,0 @@ -use bytes::Bytes; -use reqwest::header::HeaderMap; - -#[derive(Clone)] -pub struct ProxyRequest { - pub headers: HeaderMap, - pub body: Bytes, - pub target_url: String, -} - -/// Takes in individual proxy requests and aggregates them into batches to be flushed to Datadog. -pub struct ProxyAggregator { - queue: Vec, -} - -impl Default for ProxyAggregator { - fn default() -> Self { - ProxyAggregator { - queue: Vec::with_capacity(128), // arbitrary capacity for request queue - } - } -} - -impl ProxyAggregator { - /// Takes in an individual proxy request. - pub fn add(&mut self, request: ProxyRequest) { - self.queue.push(request); - } - - /// Returns a batch of proxy requests. - pub fn get_batch(&mut self) -> Vec { - std::mem::take(&mut self.queue) - } - - /// Flush the queue. - pub fn clear(&mut self) { - self.queue.clear(); - } -} \ No newline at end of file diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 94c0255d..fe2d92e3 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -1,36 +1,31 @@ // Copyright 2023-Present Datadog, Inc. https://www.datadoghq.com/ // SPDX-License-Identifier: Apache-2.0 -use std::{sync::Arc, time}; -use tokio::sync::{Mutex, OnceCell, mpsc::Receiver}; + +use bytes::Bytes; + +use std::{sync::Arc}; +use tokio::sync::{mpsc::Receiver}; use tracing::{debug, error}; use reqwest::header::HeaderMap; use crate::config::Config; -use crate::proxy_aggregator::{ProxyAggregator, ProxyRequest}; use crate::http_utils::build_client; use core::time::Duration; +pub struct ProxyRequest { + pub headers: HeaderMap, + pub body: Bytes, + pub target_url: String, +} + pub struct ProxyFlusher { - // Starts a proxy flusher that listens for proxy payloads - pub aggregator: Arc>, + /// Handles forwarding proxy requests to Datadog with retry logic pub config: Arc, client: reqwest::Client, - headers: OnceCell, } impl ProxyFlusher { - pub fn new(aggregator: Arc>, config: Arc) -> Self { - // let client = (|| -> Result> { - // let mut builder = create_reqwest_client_builder()?.timeout(Duration::from_secs(30)); - // if let Some(proxy) = &config.proxy_url { - // builder = builder.proxy(reqwest::Proxy::all(proxy)?); - // } - // Ok(builder.build()?) - // })() - // .unwrap_or_else(|e| { - // error!("Failed to create HTTP client: {}, using default", e); - // reqwest::Client::new() - // }); + pub fn new(config: Arc) -> Self { let client = build_client(config.proxy_url.as_deref(), Duration::from_secs(30)) .unwrap_or_else(|e| { error!( @@ -39,94 +34,19 @@ impl ProxyFlusher { ); reqwest::Client::new() }); - ProxyFlusher { aggregator, config, client, headers: OnceCell::new() } - } - - async fn get_headers(&self, api_key: &str) -> &HeaderMap { - self.headers - .get_or_init(move || async move { - let mut headers = HeaderMap::new(); - headers.insert( - "DD-API-KEY", - api_key.parse().expect("Failed to parse API key header"), - ); - headers - }) - .await + ProxyFlusher { config, client } } + /// 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 aggregator = Arc::clone(&self.aggregator); - tokio::spawn(async move { - while let Some(proxy_payload) = rx.recv().await { - let mut guard = aggregator.lock().await; - guard.add(proxy_payload); - } - }); - - loop { - tokio::time::sleep(time::Duration::from_secs(self.config.proxy_flush_interval)).await; - self.flush(None).await; + while let Some(proxy_payload) = rx.recv().await { + self.send_request(proxy_payload).await; } } - /// Flushes proxy requests by getting every available batch on the aggregator. - /// If `failed_requests` is provided, it will attempt to send those instead of fetching new requests. - /// Returns any requests that failed to send and should be retried. - async fn flush(&self, failed_requests: Option>) -> Option> { - let mut failed_batch: Option> = None; - - if let Some(requests) = failed_requests { - // If we have requests from a previous failed attempt, try to send those first - if !requests.is_empty() { - debug!("Proxy Flusher | Retrying {} failed requests", requests.len()); - let retry_result = self.send_requests(requests).await; - if retry_result.is_some() { - // Still failed, return to retry later - return retry_result; - } - } - } - - // Process new requests from the aggregator - let mut guard = self.aggregator.lock().await; - let mut requests = guard.get_batch(); - while !requests.is_empty() { - if let Some(failed) = self.send_requests(requests).await { - // Keep track of the failed batch - failed_batch = Some(failed); - // Stop processing more batches if we have a failure - break; - } - - requests = guard.get_batch(); - } - failed_batch - } - - // If we have requests from a previous failed attempt, try to send those first - // if failed_requests.as_ref().is_some_and(|r| !r.is_empty()) { - // let retries = failed_requests.unwrap_or_default(); - // debug!("Proxy Flusher | Retrying {} failed requests", retries.len()); - // requests = retries; - // } else { - // let mut aggregator = self.aggregator.lock().await; - // for pr in aggregator.get_batch() { - // requests.push(self.create_request(pr, self.config.proxy_intake.api_key.as_ref().unwrap()).await); - // } - // for request in requests { - // if let Some(failed) = Self::send_request(request).await { - // failed_batch = Some(failed); - // // Put requests back into the aggregator? - // break; - // } - // } - // } - // failed_batch - async fn create_request( &self, - request: ProxyRequest, + request: &ProxyRequest, api_key: &str, ) -> reqwest::RequestBuilder { let mut headers = request.headers.clone(); @@ -135,106 +55,53 @@ impl ProxyFlusher { headers.remove("host"); headers.remove("content-length"); - headers.extend(self.get_headers(api_key).await.clone()); + // Add headers to the request + headers.insert("DD-API-KEY", api_key.parse().expect("Failed to parse API key header")); - // TODO: Figure out what client to use / how data should be sent self.client .post(&request.target_url) .headers(headers) .timeout(std::time::Duration::from_secs(30)) - .body(request.body) + .body(request.body.clone()) } - async fn send_requests(&self, requests: Vec) -> Option> { - if requests.is_empty() { - return None; - } - debug!("Proxy Flusher | Attempting to send {} requests", requests.len()); + async fn send_request(&self, request: ProxyRequest) { + const MAX_RETRIES: u32 = 3; + let mut attempts = 0; - let mut failed_requests = Vec::new(); + loop { + attempts += 1; - for request_payload in requests { - // Clone the payload before creating the request builder (which consumes body) - let cloned_payload = request_payload.clone(); - let request = self.create_request(request_payload, self.config.proxy_intake.api_key.as_ref().unwrap()).await; + let request_builder = self.create_request(&request, self.config.proxy_intake.api_key.as_ref().unwrap()).await; let time = std::time::Instant::now(); - match request.send().await { + let response = request_builder.send().await; + let elapsed = time.elapsed(); + + match response { Ok(r) => { - let elapsed = time.elapsed(); let url = r.url().to_string(); let status = r.status(); let body = r.text().await; if status == 202 || status == 200 { - debug!("Proxy Flusher | Successfully sent request {url} in {} ms", elapsed.as_millis()); + debug!("Proxy Flusher | Successfully sent request in {} ms to {url}", elapsed.as_millis()); } else { error!("Proxy Flusher | Request failed with status {status}: {body:?}"); - failed_requests.push(cloned_payload); } + return; } Err(e) => { - error!("Proxy Flusher | Failed to send request: {e:?}"); - failed_requests.push(cloned_payload); + error!("Network error (attempt {}): {:?}", attempts, e); + if attempts >= MAX_RETRIES { + error!("Proxy Flusher | Failed to send request after {} attempts: {:?}", attempts, e); + return; + }; } } + // Exponential backoff + let backoff_ms = 100 * (2_u64.pow(attempts - 1)); + tokio::time::sleep(Duration::from_millis(backoff_ms)).await; } - if failed_requests.is_empty() { - None - } else { - Some(failed_requests) - } } - - // /// Given a `reqwest::RequestBuilder`, send the request and handle retries. - // async fn send_request(request: reqwest::RequestBuilder) -> Result<(), Box> { - // debug!("Proxy Flusher | Attempting to send request"); - // let mut attempts = 0; - - // loop { - // attempts += 1; - - // let Some(cloned_request) = request.try_clone() else { - // return Err(Box::new(std::io::Error::new( - // std::io::ErrorKind::Other, - // "can't clone proxy request", - // ))); - // }; - - // let time = std::time::Instant::now(); - // let response = cloned_request.send().await; - // let elapsed = time.elapsed(); - - // match response { - // Ok(r) => { - // let url = r.url().to_string(); - // let status = r.status(); - // let body = r.text().await; - // if status == 202 || status == 200 { - // debug!( - // "Proxy Flusher | Successfully sent request in {} ms to {url}", - // elapsed.as_millis() - // ); - // } else { - // error!("Proxy Flusher | Request failed with status {status}: {body:?}"); - // } - - // return Ok(()); - // } - // Err(e) => { - // if attempts >= 3 { - // error!( - // "Proxy Flusher | Failed to send request after {} attempts: {:?}", - // attempts, e - // ); - - // return Err(Box::new(FailedProxyRequestError { - // request, - // message: e.to_string(), - // })); - // } - // } - // } - // } - // } } From 9c1f4e9da9cc929211abf728985d613252c8020f Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Thu, 16 Oct 2025 17:17:32 -0400 Subject: [PATCH 04/33] cleanup --- crates/datadog-serverless-compat/src/main.rs | 2 +- .../src/{trace_aggregator.rs => aggregator.rs} | 0 crates/datadog-trace-agent/src/config.rs | 4 +--- crates/datadog-trace-agent/src/lib.rs | 2 +- crates/datadog-trace-agent/src/mini_agent.rs | 1 - crates/datadog-trace-agent/src/trace_flusher.rs | 2 +- crates/datadog-trace-agent/src/trace_processor.rs | 1 - 7 files changed, 4 insertions(+), 8 deletions(-) rename crates/datadog-trace-agent/src/{trace_aggregator.rs => aggregator.rs} (100%) diff --git a/crates/datadog-serverless-compat/src/main.rs b/crates/datadog-serverless-compat/src/main.rs index ef3d4a68..2e137499 100644 --- a/crates/datadog-serverless-compat/src/main.rs +++ b/crates/datadog-serverless-compat/src/main.rs @@ -17,7 +17,7 @@ use tracing_subscriber::EnvFilter; use zstd::zstd_safe::CompressionLevel; use datadog_trace_agent::{ - trace_aggregator::TraceAggregator, + aggregator::TraceAggregator, config, env_verifier, mini_agent, stats_flusher, stats_processor, trace_flusher::{self, TraceFlusher}, trace_processor, diff --git a/crates/datadog-trace-agent/src/trace_aggregator.rs b/crates/datadog-trace-agent/src/aggregator.rs similarity index 100% rename from crates/datadog-trace-agent/src/trace_aggregator.rs rename to crates/datadog-trace-agent/src/aggregator.rs diff --git a/crates/datadog-trace-agent/src/config.rs b/crates/datadog-trace-agent/src/config.rs index f977042e..d1975ad6 100644 --- a/crates/datadog-trace-agent/src/config.rs +++ b/crates/datadog-trace-agent/src/config.rs @@ -86,8 +86,7 @@ pub struct Config { pub trace_flush_interval: u64, pub trace_intake: Endpoint, pub trace_stats_intake: Endpoint, - /// how often to flush proxy requests, in seconds - pub proxy_flush_interval: u64, + /// the endpoint to forward proxy requests to pub proxy_intake: Endpoint, /// timeout for environment verification, in milliseconds pub verify_env_timeout: u64, @@ -143,7 +142,6 @@ impl Config { max_request_content_length: 10 * 1024 * 1024, // 10MB in Bytes trace_flush_interval: 3, stats_flush_interval: 3, - proxy_flush_interval: 3, verify_env_timeout: 100, dd_dogstatsd_port, dd_site, diff --git a/crates/datadog-trace-agent/src/lib.rs b/crates/datadog-trace-agent/src/lib.rs index 68027c46..a87bf56b 100644 --- a/crates/datadog-trace-agent/src/lib.rs +++ b/crates/datadog-trace-agent/src/lib.rs @@ -7,7 +7,7 @@ #![cfg_attr(not(test), deny(clippy::todo))] #![cfg_attr(not(test), deny(clippy::unimplemented))] -pub mod trace_aggregator; +pub mod aggregator; pub mod config; pub mod env_verifier; pub mod http_utils; diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index fa49809c..ad5ca443 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -303,5 +303,4 @@ impl MiniAgent { .status(200) .body(hyper_migration::Body::from(response_json.to_string())) } - } diff --git a/crates/datadog-trace-agent/src/trace_flusher.rs b/crates/datadog-trace-agent/src/trace_flusher.rs index 64d87bdf..c65fd4b8 100644 --- a/crates/datadog-trace-agent/src/trace_flusher.rs +++ b/crates/datadog-trace-agent/src/trace_flusher.rs @@ -10,7 +10,7 @@ use libdd_common::{hyper_migration, GenericHttpClient}; use libdd_trace_utils::trace_utils; use libdd_trace_utils::trace_utils::SendData; -use crate::trace_aggregator::TraceAggregator; +use crate::aggregator::TraceAggregator; use crate::config::Config; #[async_trait] diff --git a/crates/datadog-trace-agent/src/trace_processor.rs b/crates/datadog-trace-agent/src/trace_processor.rs index a96e03c9..e149da26 100644 --- a/crates/datadog-trace-agent/src/trace_processor.rs +++ b/crates/datadog-trace-agent/src/trace_processor.rs @@ -205,7 +205,6 @@ mod tests { os: "linux".to_string(), obfuscation_config: ObfuscationConfig::new().unwrap(), proxy_url: None, - proxy_flush_interval: 3, proxy_intake: Endpoint { url: hyper::Uri::from_static("https://proxy.agent.notdog.com/proxy"), api_key: Some("dummy_api_key".into()), From 156b8ec72b17c8e531a67a67e88ab408cca5a47a Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 17 Oct 2025 10:04:57 -0400 Subject: [PATCH 05/33] Fix error handling --- crates/datadog-serverless-compat/src/main.rs | 7 +-- crates/datadog-trace-agent/src/http_utils.rs | 7 +-- crates/datadog-trace-agent/src/mini_agent.rs | 6 +-- .../datadog-trace-agent/src/proxy_flusher.rs | 51 +++++++++++++------ 4 files changed, 43 insertions(+), 28 deletions(-) diff --git a/crates/datadog-serverless-compat/src/main.rs b/crates/datadog-serverless-compat/src/main.rs index 2e137499..18d1c5e2 100644 --- a/crates/datadog-serverless-compat/src/main.rs +++ b/crates/datadog-serverless-compat/src/main.rs @@ -18,10 +18,9 @@ use zstd::zstd_safe::CompressionLevel; use datadog_trace_agent::{ aggregator::TraceAggregator, - config, env_verifier, mini_agent, stats_flusher, stats_processor, + config, env_verifier, mini_agent, proxy_flusher, stats_flusher, stats_processor, trace_flusher::{self, TraceFlusher}, trace_processor, - proxy_flusher, }; use libdd_trace_utils::{config_utils::read_cloud_env, trace_utils::EnvironmentType}; @@ -125,9 +124,7 @@ pub async fn main() { Arc::clone(&config), )); - let proxy_flusher = Arc::new(proxy_flusher::ProxyFlusher::new( - Arc::clone(&config), - )); + let proxy_flusher = Arc::new(proxy_flusher::ProxyFlusher::new(Arc::clone(&config))); let mini_agent = Box::new(mini_agent::MiniAgent { config: Arc::clone(&config), diff --git a/crates/datadog-trace-agent/src/http_utils.rs b/crates/datadog-trace-agent/src/http_utils.rs index 0bbc26ba..f4715ed6 100644 --- a/crates/datadog-trace-agent/src/http_utils.rs +++ b/crates/datadog-trace-agent/src/http_utils.rs @@ -1,6 +1,9 @@ // Copyright 2023-Present Datadog, Inc. https://www.datadoghq.com/ // SPDX-License-Identifier: Apache-2.0 +use core::time::Duration; +use datadog_fips::reqwest_adapter::create_reqwest_client_builder; +use ddcommon::hyper_migration; use hyper::{ header, http::{self, HeaderMap}, @@ -8,10 +11,8 @@ use hyper::{ }; use libdd_common::hyper_migration; use serde_json::json; -use tracing::{debug, error}; -use datadog_fips::reqwest_adapter::create_reqwest_client_builder; -use core::time::Duration; use std::error::Error; +use tracing::{debug, error}; /// Does two things: /// 1. Logs the given message. A success status code (within 200-299) will cause an info log to be diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index ad5ca443..70cc5d82 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -88,10 +88,8 @@ impl MiniAgent { }); // channels to send processed profiling requests to our proxy flusher - let (proxy_tx, proxy_rx): ( - Sender, - Receiver, - ) = mpsc::channel(PROXY_PAYLOAD_CHANNEL_BUFFER_SIZE); + let (proxy_tx, proxy_rx): (Sender, Receiver) = + mpsc::channel(PROXY_PAYLOAD_CHANNEL_BUFFER_SIZE); // start our proxy flusher for profiling requests let proxy_flusher = self.proxy_flusher.clone(); diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index fe2d92e3..6c060362 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -3,10 +3,10 @@ use bytes::Bytes; -use std::{sync::Arc}; -use tokio::sync::{mpsc::Receiver}; -use tracing::{debug, error}; use reqwest::header::HeaderMap; +use std::sync::Arc; +use tokio::sync::mpsc::Receiver; +use tracing::{debug, error}; use crate::config::Config; use crate::http_utils::build_client; @@ -19,7 +19,6 @@ pub struct ProxyRequest { } pub struct ProxyFlusher { - /// Handles forwarding proxy requests to Datadog with retry logic pub config: Arc, client: reqwest::Client, } @@ -39,8 +38,13 @@ 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.proxy_intake.api_key.as_ref() else { + error!("Proxy Flusher | No API key configured, cannot start"); + return; + }; + while let Some(proxy_payload) = rx.recv().await { - self.send_request(proxy_payload).await; + self.send_request(proxy_payload, api_key).await; } } @@ -48,7 +52,7 @@ impl ProxyFlusher { &self, request: &ProxyRequest, api_key: &str, - ) -> reqwest::RequestBuilder { + ) -> Result { let mut headers = request.headers.clone(); // Remove headers that are not needed for the proxy request @@ -56,23 +60,34 @@ impl ProxyFlusher { headers.remove("content-length"); // Add headers to the request - headers.insert("DD-API-KEY", api_key.parse().expect("Failed to parse API key header")); + match api_key.parse() { + Ok(parsed_key) => headers.insert("DD-API-KEY", parsed_key), + Err(e) => return Err(format!("Failed to parse API key: {}", e)), + }; - self.client + Ok(self + .client .post(&request.target_url) .headers(headers) .timeout(std::time::Duration::from_secs(30)) - .body(request.body.clone()) + .body(request.body.clone())) } - async fn send_request(&self, request: ProxyRequest) { + async fn send_request(&self, request: ProxyRequest, api_key: &str) { const MAX_RETRIES: u32 = 3; let mut attempts = 0; loop { attempts += 1; - let request_builder = self.create_request(&request, self.config.proxy_intake.api_key.as_ref().unwrap()).await; + let request_builder = match self.create_request(&request, api_key).await { + Ok(builder) => builder, + Err(e) => { + error!("Proxy Flusher | {}", e); + return; + } + }; + let time = std::time::Instant::now(); let response = request_builder.send().await; let elapsed = time.elapsed(); @@ -83,7 +98,10 @@ impl ProxyFlusher { let status = r.status(); let body = r.text().await; if status == 202 || status == 200 { - debug!("Proxy Flusher | Successfully sent request in {} ms to {url}", elapsed.as_millis()); + debug!( + "Proxy Flusher | Successfully sent request in {} ms to {url}", + elapsed.as_millis() + ); } else { error!("Proxy Flusher | Request failed with status {status}: {body:?}"); } @@ -92,7 +110,10 @@ impl ProxyFlusher { Err(e) => { error!("Network error (attempt {}): {:?}", attempts, e); if attempts >= MAX_RETRIES { - error!("Proxy Flusher | Failed to send request after {} attempts: {:?}", attempts, e); + error!( + "Proxy Flusher | Failed to send request after {} attempts: {:?}", + attempts, e + ); return; }; } @@ -101,7 +122,5 @@ impl ProxyFlusher { let backoff_ms = 100 * (2_u64.pow(attempts - 1)); tokio::time::sleep(Duration::from_millis(backoff_ms)).await; } - - } + } } - From 38702585c53c1b6ab77febb3c6f44584ad2abb0c Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 17 Oct 2025 10:25:14 -0400 Subject: [PATCH 06/33] Fix reqwest dependency --- Cargo.lock | 195 +------------------ crates/datadog-trace-agent/Cargo.toml | 2 +- crates/datadog-trace-agent/src/http_utils.rs | 1 - 3 files changed, 3 insertions(+), 195 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd8c38c9..804e697d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -317,16 +317,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation" version = "0.10.1" @@ -557,15 +547,6 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - [[package]] name = "equivalent" version = "1.0.2" @@ -646,21 +627,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.2" @@ -1042,22 +1008,6 @@ dependencies = [ "webpki-roots 1.0.4", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.19" @@ -1077,11 +1027,9 @@ dependencies = [ "percent-encoding", "pin-project-lite", "socket2", - "system-configuration", "tokio", "tower-service", "tracing", - "windows-registry", ] [[package]] @@ -1504,23 +1452,6 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" -[[package]] -name = "native-tls" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework 2.11.1", - "security-framework-sys", - "tempfile", -] - [[package]] name = "nix" version = "0.29.0" @@ -1567,50 +1498,12 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" -[[package]] -name = "openssl" -version = "0.10.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.111", -] - [[package]] name = "openssl-probe" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" -[[package]] -name = "openssl-sys" -version = "0.9.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "ordered-float" version = "4.6.0" @@ -2092,7 +1985,6 @@ checksum = "3b4c14b2d9afca6a60277086b0cc6a6ae0b568f6f7916c943a8cdc79f8be240f" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "h2", "http", @@ -2100,12 +1992,9 @@ dependencies = [ "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "js-sys", "log", - "mime", - "native-tls", "percent-encoding", "pin-project-lite", "quinn", @@ -2116,7 +2005,6 @@ dependencies = [ "serde_urlencoded", "sync_wrapper", "tokio", - "tokio-native-tls", "tokio-rustls", "tower", "tower-http", @@ -2230,7 +2118,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.5.1", + "security-framework", ] [[package]] @@ -2294,19 +2182,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation 0.9.4", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - [[package]] name = "security-framework" version = "3.5.1" @@ -2314,7 +2189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" dependencies = [ "bitflags", - "core-foundation 0.10.1", + "core-foundation", "core-foundation-sys", "libc", "security-framework-sys", @@ -2574,27 +2449,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation 0.9.4", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "tabwriter" version = "1.4.1" @@ -2718,16 +2572,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.4" @@ -3009,12 +2853,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -3168,35 +3006,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-registry" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" -dependencies = [ - "windows-link", - "windows-result", - "windows-strings", -] - -[[package]] -name = "windows-result" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-strings" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" -dependencies = [ - "windows-link", -] - [[package]] name = "windows-sys" version = "0.52.0" diff --git a/crates/datadog-trace-agent/Cargo.toml b/crates/datadog-trace-agent/Cargo.toml index f15d12c4..aaccf430 100644 --- a/crates/datadog-trace-agent/Cargo.toml +++ b/crates/datadog-trace-agent/Cargo.toml @@ -27,7 +27,7 @@ libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "4351 "mini_agent", ] } datadog-fips = { path = "../datadog-fips", default-features = false } -reqwest = { version = "0.12.23", features = ["json"] } +reqwest = { version = "0.12.23", features = ["json", "http2"], default-features = false } bytes = "1.10.1" [dev-dependencies] diff --git a/crates/datadog-trace-agent/src/http_utils.rs b/crates/datadog-trace-agent/src/http_utils.rs index f4715ed6..ba56cb39 100644 --- a/crates/datadog-trace-agent/src/http_utils.rs +++ b/crates/datadog-trace-agent/src/http_utils.rs @@ -3,7 +3,6 @@ use core::time::Duration; use datadog_fips::reqwest_adapter::create_reqwest_client_builder; -use ddcommon::hyper_migration; use hyper::{ header, http::{self, HeaderMap}, From 7dbb84ad0fe17a2e11a3f5c57dfcd682e637b5c9 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 17 Oct 2025 13:41:26 -0400 Subject: [PATCH 07/33] Fix license --- LICENSE-3rdparty.csv | 80 +++++++++---------- crates/datadog-trace-agent/src/mini_agent.rs | 4 +- .../datadog-trace-agent/src/proxy_flusher.rs | 9 ++- 3 files changed, 47 insertions(+), 46 deletions(-) diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index c531df87..81f1eb92 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -1,5 +1,4 @@ Component,Origin,License,Copyright -addr2line,https://github.com/gimli-rs/addr2line,Apache-2.0 OR MIT,The addr2line Authors adler2,https://github.com/oyvindln/adler2,0BSD OR MIT OR Apache-2.0,"Jonas Schievink , oyvindln " ahash,https://github.com/tkaitchuck/ahash,MIT OR Apache-2.0,Tom Kaitchuck aho-corasick,https://github.com/BurntSushi/aho-corasick,Unlicense OR MIT,Andrew Gallant @@ -11,8 +10,6 @@ async-trait,https://github.com/dtolnay/async-trait,MIT OR Apache-2.0,David Tolna atomic-waker,https://github.com/smol-rs/atomic-waker,Apache-2.0 OR MIT,"Stjepan Glavina , Contributors to futures-rs" aws-lc-rs,https://github.com/aws/aws-lc-rs,ISC AND (Apache-2.0 OR ISC),AWS-LibCrypto aws-lc-sys,https://github.com/aws/aws-lc-rs,ISC AND (Apache-2.0 OR ISC) AND OpenSSL,AWS-LC -backtrace,https://github.com/rust-lang/backtrace-rs,MIT OR Apache-2.0,The Rust Project Developers -base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,"Alice Maz , Marshall Pierce " base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,Marshall Pierce bit-set,https://github.com/contain-rs/bit-set,Apache-2.0 OR MIT,Alexis Beingessner bit-vec,https://github.com/contain-rs/bit-vec,Apache-2.0 OR MIT,Alexis Beingessner @@ -26,7 +23,7 @@ cargo-platform,https://github.com/rust-lang/cargo,MIT OR Apache-2.0,The cargo-pl cargo_metadata,https://github.com/oli-obk/cargo_metadata,MIT,Oliver Schneider cc,https://github.com/rust-lang/cc-rs,MIT OR Apache-2.0,Alex Crichton cexpr,https://github.com/jethrogb/rust-cexpr,Apache-2.0 OR MIT,Jethro Beekman -cfg-if,https://github.com/alexcrichton/cfg-if,MIT OR Apache-2.0,Alex Crichton +cfg-if,https://github.com/rust-lang/cfg-if,MIT OR Apache-2.0,Alex Crichton clang-sys,https://github.com/KyleMayes/clang-sys,Apache-2.0,Kyle Mayes concurrent-queue,https://github.com/smol-rs/concurrent-queue,Apache-2.0 OR MIT,"Stjepan Glavina , Taiki Endo , John Nunley " const_format,https://github.com/rodrimati1992/const_format_crates,Zlib,rodrimati1992 @@ -46,10 +43,11 @@ digest,https://github.com/RustCrypto/traits,MIT OR Apache-2.0,RustCrypto Develop displaydoc,https://github.com/yaahc/displaydoc,MIT OR Apache-2.0,Jane Lusby either,https://github.com/rayon-rs/either,MIT OR Apache-2.0,bluss equivalent,https://github.com/indexmap-rs/equivalent,Apache-2.0 OR MIT,The equivalent Authors -errno,https://github.com/lambda-fairy/rust-errno,MIT OR Apache-2.0,Chris Wong +errno,https://github.com/lambda-fairy/rust-errno,MIT OR Apache-2.0,"Chris Wong , Dan Gohman " event-listener,https://github.com/smol-rs/event-listener,Apache-2.0 OR MIT,"Stjepan Glavina , John Nunley " event-listener-strategy,https://github.com/smol-rs/event-listener-strategy,Apache-2.0 OR MIT,John Nunley fastrand,https://github.com/smol-rs/fastrand,Apache-2.0 OR MIT,Stjepan Glavina +find-msvc-tools,https://github.com/rust-lang/cc-rs,MIT OR Apache-2.0,The find-msvc-tools Authors fixedbitset,https://github.com/petgraph/fixedbitset,MIT OR Apache-2.0,bluss flate2,https://github.com/rust-lang/flate2-rs,MIT OR Apache-2.0,"Alex Crichton , Josh Triplett " float-cmp,https://github.com/mikedilger/float-cmp,MIT,Mike Dilger @@ -67,7 +65,6 @@ futures-timer,https://github.com/async-rs/futures-timer,MIT OR Apache-2.0,Alex C futures-util,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-util Authors generic-array,https://github.com/fizyk20/generic-array,MIT,"Bartłomiej Kamiński , Aaron Trent " getrandom,https://github.com/rust-random/getrandom,MIT OR Apache-2.0,The Rand Project Developers -gimli,https://github.com/gimli-rs/gimli,MIT OR Apache-2.0,The gimli Authors glob,https://github.com/rust-lang/glob,MIT OR Apache-2.0,The Rust Project Developers h2,https://github.com/hyperium/h2,MIT,"Carl Lerche , Sean McArthur " hashbrown,https://github.com/rust-lang/hashbrown,MIT OR Apache-2.0,Amanieu d'Antras @@ -88,25 +85,22 @@ hyper-http-proxy,https://github.com/metalbear-co/hyper-http-proxy,MIT,MetalBear hyper-rustls,https://github.com/rustls/hyper-rustls,Apache-2.0 OR ISC OR MIT,The hyper-rustls Authors hyper-util,https://github.com/hyperium/hyper-util,MIT,Sean McArthur icu_collections,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers -icu_locid,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers -icu_locid_transform,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers -icu_locid_transform_data,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +icu_locale_core,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers icu_normalizer,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers icu_normalizer_data,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers icu_properties,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers icu_properties_data,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers icu_provider,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers -icu_provider_macros,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers idna,https://github.com/servo/rust-url,MIT OR Apache-2.0,The rust-url developers idna_adapter,https://github.com/hsivonen/idna_adapter,Apache-2.0 OR MIT,The rust-url developers indexmap,https://github.com/indexmap-rs/indexmap,Apache-2.0 OR MIT,The indexmap Authors ipnet,https://github.com/krisprice/ipnet,MIT OR Apache-2.0,Kris Price +iri-string,https://github.com/lo48576/iri-string,MIT OR Apache-2.0,YOSHIOKA Takuma itertools,https://github.com/rust-itertools/itertools,MIT OR Apache-2.0,bluss itoa,https://github.com/dtolnay/itoa,MIT OR Apache-2.0,David Tolnay jobserver,https://github.com/rust-lang/jobserver-rs,MIT OR Apache-2.0,Alex Crichton -js-sys,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/js-sys,MIT OR Apache-2.0,The wasm-bindgen Developers +js-sys,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys,MIT OR Apache-2.0,The wasm-bindgen Developers lazy_static,https://github.com/rust-lang-nursery/lazy-static.rs,MIT OR Apache-2.0,Marvin Löbel -lazycell,https://github.com/indiv0/lazycell,MIT OR Apache-2.0,"Alex Crichton , Nikita Pekin " libc,https://github.com/rust-lang/libc,MIT OR Apache-2.0,The Rust Project Developers libdd-common,https://github.com/DataDog/libdatadog/tree/main/datadog-common,Apache-2.0,The libdd-common Authors libdd-tinybytes,https://github.com/DataDog/libdatadog/tree/main/libdd-tinybytes,Apache-2.0,The libdd-tinybytes Authors @@ -119,6 +113,7 @@ linux-raw-sys,https://github.com/sunfishcode/linux-raw-sys,Apache-2.0 WITH LLVM- litemap,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers lock_api,https://github.com/Amanieu/parking_lot,MIT OR Apache-2.0,Amanieu d'Antras log,https://github.com/rust-lang/log,MIT OR Apache-2.0,The Rust Project Developers +lru-slab,https://github.com/Ralith/lru-slab,MIT OR Apache-2.0 OR Zlib,Benjamin Saunders matchers,https://github.com/hawkw/matchers,MIT,Eliza Weisman memchr,https://github.com/BurntSushi/memchr,Unlicense OR MIT,"Andrew Gallant , bluss" mime,https://github.com/hyperium/mime,MIT OR Apache-2.0,Sean McArthur @@ -130,11 +125,9 @@ nix,https://github.com/nix-rust/nix,MIT,The nix-rust Project Developers nom,https://github.com/Geal/nom,MIT,contact@geoffroycouprie.com nu-ansi-term,https://github.com/nushell/nu-ansi-term,MIT,"ogham@bsago.me, Ryan Scheel (Havvy) , Josh Triplett , The Nushell Project Developers" num-traits,https://github.com/rust-num/num-traits,MIT OR Apache-2.0,The Rust Project Developers -object,https://github.com/gimli-rs/object,Apache-2.0 OR MIT,The object Authors once_cell,https://github.com/matklad/once_cell,MIT OR Apache-2.0,Aleksey Kladov openssl-probe,https://github.com/alexcrichton/openssl-probe,MIT OR Apache-2.0,Alex Crichton ordered-float,https://github.com/reem/rust-ordered-float,MIT,"Jonathan Reem , Matt Brubeck " -overload,https://github.com/danaugrs/overload,MIT,Daniel Salvadori parking,https://github.com/smol-rs/parking,Apache-2.0 OR MIT,"Stjepan Glavina , The Rust Project Developers" parking_lot,https://github.com/Amanieu/parking_lot,MIT OR Apache-2.0,Amanieu d'Antras parking_lot_core,https://github.com/Amanieu/parking_lot,MIT OR Apache-2.0,Amanieu d'Antras @@ -146,6 +139,7 @@ pin-project,https://github.com/taiki-e/pin-project,Apache-2.0 OR MIT,The pin-pro pin-project-internal,https://github.com/taiki-e/pin-project,Apache-2.0 OR MIT,The pin-project-internal Authors pin-project-lite,https://github.com/taiki-e/pin-project-lite,Apache-2.0 OR MIT,The pin-project-lite Authors pin-utils,https://github.com/rust-lang-nursery/pin-utils,MIT OR Apache-2.0,Josef Brandl +potential_utf,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers ppv-lite86,https://github.com/cryptocorrosion/cryptocorrosion,MIT OR Apache-2.0,The CryptoCorrosion Contributors prettyplease,https://github.com/dtolnay/prettyplease,MIT OR Apache-2.0,David Tolnay proc-macro-error,https://gitlab.com/CreepySkeleton/proc-macro-error,MIT OR Apache-2.0,CreepySkeleton @@ -170,25 +164,19 @@ rand_core,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Projec rand_xorshift,https://github.com/rust-random/rngs,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers" redox_syscall,https://gitlab.redox-os.org/redox-os/syscall,MIT,Jeremy Soller regex,https://github.com/rust-lang/regex,MIT OR Apache-2.0,"The Rust Project Developers, Andrew Gallant " -regex-automata,https://github.com/BurntSushi/regex-automata,Unlicense OR MIT,Andrew Gallant -regex-automata,https://github.com/rust-lang/regex/tree/master/regex-automata,MIT OR Apache-2.0,"The Rust Project Developers, Andrew Gallant " -regex-syntax,https://github.com/rust-lang/regex,MIT OR Apache-2.0,The Rust Project Developers -regex-syntax,https://github.com/rust-lang/regex/tree/master/regex-syntax,MIT OR Apache-2.0,"The Rust Project Developers, Andrew Gallant " +regex-automata,https://github.com/rust-lang/regex,MIT OR Apache-2.0,"The Rust Project Developers, Andrew Gallant " +regex-syntax,https://github.com/rust-lang/regex,MIT OR Apache-2.0,"The Rust Project Developers, Andrew Gallant " reqwest,https://github.com/seanmonstar/reqwest,MIT OR Apache-2.0,Sean McArthur ring,https://github.com/briansmith/ring,Apache-2.0 AND ISC,The ring Authors rmp,https://github.com/3Hren/msgpack-rust,MIT,Evgeny Safronov rmp-serde,https://github.com/3Hren/msgpack-rust,MIT,Evgeny Safronov rmpv,https://github.com/3Hren/msgpack-rust,MIT,Evgeny Safronov -rustc-demangle,https://github.com/rust-lang/rustc-demangle,MIT OR Apache-2.0,Alex Crichton -rustc-hash,https://github.com/rust-lang-nursery/rustc-hash,Apache-2.0 OR MIT,The Rust Project Developers rustc-hash,https://github.com/rust-lang/rustc-hash,Apache-2.0 OR MIT,The Rust Project Developers rustix,https://github.com/bytecodealliance/rustix,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,"Dan Gohman , Jakub Konka " rustls,https://github.com/rustls/rustls,Apache-2.0 OR ISC OR MIT,The rustls Authors rustls-native-certs,https://github.com/rustls/rustls-native-certs,Apache-2.0 OR ISC OR MIT,The rustls-native-certs Authors -rustls-pemfile,https://github.com/rustls/pemfile,Apache-2.0 OR ISC OR MIT,The rustls-pemfile Authors rustls-pki-types,https://github.com/rustls/pki-types,MIT OR Apache-2.0,The rustls-pki-types Authors rustls-webpki,https://github.com/rustls/webpki,ISC,The rustls-webpki Authors -rustversion,https://github.com/dtolnay/rustversion,MIT OR Apache-2.0,David Tolnay rusty-fork,https://github.com/altsysrq/rusty-fork,MIT OR Apache-2.0,Jason Lingle ryu,https://github.com/dtolnay/ryu,Apache-2.0 OR BSL-1.0,David Tolnay schannel,https://github.com/steffengy/schannel-rs,MIT,"Steven Fackler , Steffen Butzer " @@ -198,6 +186,7 @@ security-framework-sys,https://github.com/kornelski/rust-security-framework,MIT semver,https://github.com/dtolnay/semver,MIT OR Apache-2.0,David Tolnay serde,https://github.com/serde-rs/serde,MIT OR Apache-2.0,"Erick Tryzelaar , David Tolnay " serde_bytes,https://github.com/serde-rs/bytes,MIT OR Apache-2.0,David Tolnay +serde_core,https://github.com/serde-rs/serde,MIT OR Apache-2.0,"Erick Tryzelaar , David Tolnay " serde_derive,https://github.com/serde-rs/serde,MIT OR Apache-2.0,"Erick Tryzelaar , David Tolnay " serde_json,https://github.com/serde-rs/json,MIT OR Apache-2.0,"Erick Tryzelaar , David Tolnay " serde_regex,https://github.com/tailhook/serde-regex,MIT OR Apache-2.0,paul@colomiets.name @@ -207,6 +196,7 @@ sha1,https://github.com/RustCrypto/hashes,MIT OR Apache-2.0,RustCrypto Developer sharded-slab,https://github.com/hawkw/sharded-slab,MIT,Eliza Weisman shlex,https://github.com/comex/rust-shlex,MIT OR Apache-2.0,"comex , Fenhl , Adrian Taylor , Alex Touchet , Daniel Parks , Garrett Berg " signal-hook-registry,https://github.com/vorner/signal-hook,Apache-2.0 OR MIT,"Michal 'vorner' Vaner , Masaki Hara " +simd-adler32,https://github.com/mcountryman/simd-adler32,MIT,Marvin Countryman similar,https://github.com/mitsuhiko/similar,Apache-2.0,"Armin Ronacher , Pierre-Étienne Meunier , Brandon Williams " slab,https://github.com/tokio-rs/slab,MIT,Carl Lerche smallvec,https://github.com/servo/rust-smallvec,MIT OR Apache-2.0,The Servo Project Developers @@ -233,6 +223,7 @@ tokio-stream,https://github.com/tokio-rs/tokio,MIT,Tokio Contributors tonic,https://github.com/hyperium/tonic,MIT,Lucio Franco tower,https://github.com/tower-rs/tower,MIT,Tower Maintainers +tower-http,https://github.com/tower-rs/tower-http,MIT,Tower Maintainers tower-layer,https://github.com/tower-rs/tower,MIT,Tower Maintainers tower-service,https://github.com/tower-rs/tower,MIT,Tower Maintainers tracing,https://github.com/tokio-rs/tracing,MIT,"Eliza Weisman , Tokio Contributors " @@ -251,52 +242,53 @@ untrusted,https://github.com/briansmith/untrusted,ISC,Brian Smith , Bertram Truong " ustr,https://github.com/anderslanglands/ustr,BSD-2-Clause-Patent,Anders Langlands -utf16_iter,https://github.com/hsivonen/utf16_iter,Apache-2.0 OR MIT,Henri Sivonen utf8_iter,https://github.com/hsivonen/utf8_iter,Apache-2.0 OR MIT,Henri Sivonen valuable,https://github.com/tokio-rs/valuable,MIT,The valuable Authors wait-timeout,https://github.com/alexcrichton/wait-timeout,MIT OR Apache-2.0,Alex Crichton want,https://github.com/seanmonstar/want,MIT,Sean McArthur wasi,https://github.com/bytecodealliance/wasi,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The Cranelift Project Developers -wasi,https://github.com/bytecodealliance/wasi-rs,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The Cranelift Project Developers -wasm-bindgen,https://github.com/rustwasm/wasm-bindgen,MIT OR Apache-2.0,The wasm-bindgen Developers -wasm-bindgen-backend,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend,MIT OR Apache-2.0,The wasm-bindgen Developers -wasm-bindgen-futures,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/futures,MIT OR Apache-2.0,The wasm-bindgen Developers -wasm-bindgen-macro,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro,MIT OR Apache-2.0,The wasm-bindgen Developers -wasm-bindgen-macro-support,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro-support,MIT OR Apache-2.0,The wasm-bindgen Developers -wasm-bindgen-shared,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/shared,MIT OR Apache-2.0,The wasm-bindgen Developers -web-sys,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys,MIT OR Apache-2.0,The wasm-bindgen Developers +wasip2,https://github.com/bytecodealliance/wasi-rs,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The wasip2 Authors +wasm-bindgen,https://github.com/wasm-bindgen/wasm-bindgen,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-backend,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/backend,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-futures,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/futures,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-macro,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-macro-support,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro-support,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-shared,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/shared,MIT OR Apache-2.0,The wasm-bindgen Developers +web-sys,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/web-sys,MIT OR Apache-2.0,The wasm-bindgen Developers web-time,https://github.com/daxpedda/web-time,MIT OR Apache-2.0,The web-time Authors -webpki-roots,https://github.com/rustls/webpki-roots,MPL-2.0,The webpki-roots Authors +webpki-roots,https://github.com/rustls/webpki-roots,CDLA-Permissive-2.0,The webpki-roots Authors which,https://github.com/harryfei/which-rs,MIT,Harry Fei -winapi,https://github.com/retep998/winapi-rs,MIT OR Apache-2.0,Peter Atashian -winapi-i686-pc-windows-gnu,https://github.com/retep998/winapi-rs,MIT OR Apache-2.0,Peter Atashian -winapi-x86_64-pc-windows-gnu,https://github.com/retep998/winapi-rs,MIT OR Apache-2.0,Peter Atashian -windows-link,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft -windows-registry,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft -windows-result,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft -windows-strings,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows-link,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-link Authors windows-sys,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows-sys,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-sys Authors windows-targets,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows-targets,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-targets Authors windows_aarch64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_aarch64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows_aarch64_gnullvm Authors windows_aarch64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_aarch64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows_aarch64_msvc Authors windows_i686_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_i686_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows_i686_gnu Authors windows_i686_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_i686_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows_i686_gnullvm Authors windows_i686_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_i686_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows_i686_msvc Authors windows_x86_64_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_x86_64_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows_x86_64_gnu Authors windows_x86_64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_x86_64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows_x86_64_gnullvm Authors windows_x86_64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft -wit-bindgen-rt,https://github.com/bytecodealliance/wit-bindgen,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The wit-bindgen-rt Authors -write16,https://github.com/hsivonen/write16,Apache-2.0 OR MIT,The write16 Authors +windows_x86_64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows_x86_64_msvc Authors +wit-bindgen,https://github.com/bytecodealliance/wit-bindgen,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Alex Crichton writeable,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers yoke,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar yoke-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar -zerocopy,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,Joshua Liebow-Feeser zerocopy,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,"Joshua Liebow-Feeser , Jack Wrenn " -zerocopy-derive,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,Joshua Liebow-Feeser zerocopy-derive,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,"Joshua Liebow-Feeser , Jack Wrenn " zerofrom,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar zerofrom-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar -zeroize,https://github.com/RustCrypto/utils/tree/master/zeroize,Apache-2.0 OR MIT,The RustCrypto Project Developers +zeroize,https://github.com/RustCrypto/utils,Apache-2.0 OR MIT,The RustCrypto Project Developers +zerotrie,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers zerovec,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers zerovec-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar zstd,https://github.com/gyscos/zstd-rs,MIT,Alexandre Bury diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index 70cc5d82..b510318c 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -240,7 +240,7 @@ impl MiniAgent { request: hyper_migration::HttpRequest, proxy_tx: Sender, ) -> http::Result { - debug!("Trace Agent | Proxied request for profiling"); + debug!("Trace Agent | Received profiling request"); // Extract headers and body let (parts, body) = request.into_parts(); @@ -269,6 +269,8 @@ impl MiniAgent { target_url: config.proxy_intake.url.to_string(), }; + debug!("Trace Agent | Sending profiling request to channel, target: {}", proxy_request.target_url); + // Send to channel match proxy_tx.send(proxy_request).await { Ok(_) => log_and_create_http_response( diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 6c060362..4eae6269 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -25,6 +25,7 @@ pub struct ProxyFlusher { impl ProxyFlusher { pub fn new(config: Arc) -> Self { + debug!("Proxy Flusher | Creating new proxy flusher with target URL: {}", config.proxy_intake.url); let client = build_client(config.proxy_url.as_deref(), Duration::from_secs(30)) .unwrap_or_else(|e| { error!( @@ -43,7 +44,10 @@ impl ProxyFlusher { return; }; + debug!("Proxy Flusher | Started, listening for requests"); + while let Some(proxy_payload) = rx.recv().await { + debug!("Proxy Flusher | Received request from channel, body size: {} bytes", proxy_payload.body.len()); self.send_request(proxy_payload, api_key).await; } } @@ -88,6 +92,8 @@ impl ProxyFlusher { } }; + debug!("Proxy Flusher | Sending request (attempt {}/{})", attempts, MAX_RETRIES); + let time = std::time::Instant::now(); let response = request_builder.send().await; let elapsed = time.elapsed(); @@ -108,7 +114,7 @@ impl ProxyFlusher { return; } Err(e) => { - error!("Network error (attempt {}): {:?}", attempts, e); + error!("Proxy Flusher | Network error (attempt {}): {:?}", attempts, e); if attempts >= MAX_RETRIES { error!( "Proxy Flusher | Failed to send request after {} attempts: {:?}", @@ -120,6 +126,7 @@ impl ProxyFlusher { } // Exponential backoff let backoff_ms = 100 * (2_u64.pow(attempts - 1)); + debug!("Proxy Flusher | Retrying after {}ms backoff", backoff_ms); tokio::time::sleep(Duration::from_millis(backoff_ms)).await; } } From 57449316bb9f992484da9fc8cc08fbd4d91c12f3 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 17 Oct 2025 13:42:27 -0400 Subject: [PATCH 08/33] nit: formatting --- crates/datadog-trace-agent/src/mini_agent.rs | 5 ++++- .../datadog-trace-agent/src/proxy_flusher.rs | 20 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index b510318c..d6319afa 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -269,7 +269,10 @@ impl MiniAgent { target_url: config.proxy_intake.url.to_string(), }; - debug!("Trace Agent | Sending profiling request to channel, target: {}", proxy_request.target_url); + debug!( + "Trace Agent | Sending profiling request to channel, target: {}", + proxy_request.target_url + ); // Send to channel match proxy_tx.send(proxy_request).await { diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 4eae6269..d6c9f205 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -25,7 +25,10 @@ pub struct ProxyFlusher { impl ProxyFlusher { pub fn new(config: Arc) -> Self { - debug!("Proxy Flusher | Creating new proxy flusher with target URL: {}", config.proxy_intake.url); + debug!( + "Proxy Flusher | Creating new proxy flusher with target URL: {}", + config.proxy_intake.url + ); let client = build_client(config.proxy_url.as_deref(), Duration::from_secs(30)) .unwrap_or_else(|e| { error!( @@ -47,7 +50,10 @@ impl ProxyFlusher { debug!("Proxy Flusher | Started, listening for requests"); while let Some(proxy_payload) = rx.recv().await { - debug!("Proxy Flusher | Received request from channel, body size: {} bytes", proxy_payload.body.len()); + debug!( + "Proxy Flusher | Received request from channel, body size: {} bytes", + proxy_payload.body.len() + ); self.send_request(proxy_payload, api_key).await; } } @@ -92,7 +98,10 @@ impl ProxyFlusher { } }; - debug!("Proxy Flusher | Sending request (attempt {}/{})", attempts, MAX_RETRIES); + debug!( + "Proxy Flusher | Sending request (attempt {}/{})", + attempts, MAX_RETRIES + ); let time = std::time::Instant::now(); let response = request_builder.send().await; @@ -114,7 +123,10 @@ impl ProxyFlusher { return; } Err(e) => { - error!("Proxy Flusher | Network error (attempt {}): {:?}", attempts, e); + error!( + "Proxy Flusher | Network error (attempt {}): {:?}", + attempts, e + ); if attempts >= MAX_RETRIES { error!( "Proxy Flusher | Failed to send request after {} attempts: {:?}", From 15ddf9fc3ccca77d6f3209ddfc9ff30d6e6d75c1 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 17 Oct 2025 14:11:03 -0400 Subject: [PATCH 09/33] Renaming for clarity --- crates/datadog-trace-agent/src/config.rs | 11 ++++++----- crates/datadog-trace-agent/src/mini_agent.rs | 2 +- crates/datadog-trace-agent/src/proxy_flusher.rs | 4 ++-- crates/datadog-trace-agent/src/trace_processor.rs | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/crates/datadog-trace-agent/src/config.rs b/crates/datadog-trace-agent/src/config.rs index d1975ad6..95268cbc 100644 --- a/crates/datadog-trace-agent/src/config.rs +++ b/crates/datadog-trace-agent/src/config.rs @@ -86,8 +86,8 @@ pub struct Config { pub trace_flush_interval: u64, pub trace_intake: Endpoint, pub trace_stats_intake: Endpoint, - /// the endpoint to forward proxy requests to - pub proxy_intake: Endpoint, + /// the endpoint to forward profiling requests to + pub profiling_intake: Endpoint, /// timeout for environment verification, in milliseconds pub verify_env_timeout: u64, pub proxy_url: Option, @@ -113,7 +113,8 @@ impl Config { // trace stats to) let mut trace_intake_url = trace_intake_url(&dd_site); let mut trace_stats_intake_url = trace_stats_url(&dd_site); - let proxy_intake_url = format!("https://intake.profile.{}/api/v2/profile", dd_site); + + let profiling_intake_url = format!("https://intake.profile.{}/api/v2/profile", dd_site); // DD_APM_DD_URL env var will primarily be used for integration tests // overrides the entire trace/trace stats intake url prefix @@ -155,8 +156,8 @@ impl Config { api_key: Some(api_key.clone()), ..Default::default() }, - proxy_intake: Endpoint { - url: hyper::Uri::from_str(&proxy_intake_url).unwrap(), + profiling_intake: Endpoint { + url: hyper::Uri::from_str(&profiling_intake_url).unwrap(), api_key: Some(api_key), ..Default::default() }, diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index d6319afa..7cedf7d3 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -266,7 +266,7 @@ impl MiniAgent { let proxy_request = ProxyRequest { headers: parts.headers, body: body_bytes, - target_url: config.proxy_intake.url.to_string(), + target_url: config.profiling_intake.url.to_string(), }; debug!( diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index d6c9f205..7d2ace78 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -27,7 +27,7 @@ impl ProxyFlusher { pub fn new(config: Arc) -> Self { debug!( "Proxy Flusher | Creating new proxy flusher with target URL: {}", - config.proxy_intake.url + config.profiling_intake.url ); let client = build_client(config.proxy_url.as_deref(), Duration::from_secs(30)) .unwrap_or_else(|e| { @@ -42,7 +42,7 @@ 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.proxy_intake.api_key.as_ref() else { + let Some(api_key) = self.config.profiling_intake.api_key.as_ref() else { error!("Proxy Flusher | No API key configured, cannot start"); return; }; diff --git a/crates/datadog-trace-agent/src/trace_processor.rs b/crates/datadog-trace-agent/src/trace_processor.rs index e149da26..1c4cfa3b 100644 --- a/crates/datadog-trace-agent/src/trace_processor.rs +++ b/crates/datadog-trace-agent/src/trace_processor.rs @@ -205,7 +205,7 @@ mod tests { os: "linux".to_string(), obfuscation_config: ObfuscationConfig::new().unwrap(), proxy_url: None, - proxy_intake: Endpoint { + profiling_intake: Endpoint { url: hyper::Uri::from_static("https://proxy.agent.notdog.com/proxy"), api_key: Some("dummy_api_key".into()), ..Default::default() From c5d51af6810c35d7a7d3fb4d005de2cdc69d6aa8 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 17 Oct 2025 14:46:13 -0400 Subject: [PATCH 10/33] Minor refactoring --- crates/datadog-trace-agent/src/config.rs | 14 ++++++- .../datadog-trace-agent/src/proxy_flusher.rs | 41 +++++++++++-------- crates/dogstatsd/src/datadog.rs | 2 +- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/crates/datadog-trace-agent/src/config.rs b/crates/datadog-trace-agent/src/config.rs index 95268cbc..8a760835 100644 --- a/crates/datadog-trace-agent/src/config.rs +++ b/crates/datadog-trace-agent/src/config.rs @@ -86,8 +86,16 @@ pub struct Config { pub trace_flush_interval: u64, pub trace_intake: Endpoint, pub trace_stats_intake: Endpoint, - /// the endpoint to forward profiling requests to + /// Profiling intake endpoint (for proxying profiling data to Datadog) pub profiling_intake: Endpoint, + /// HTTP client timeout for proxy requests, in milliseconds + pub proxy_client_timeout: u64, + /// Individual request timeout for proxy requests, in seconds + pub proxy_request_timeout: u64, + /// Maximum number of retry attempts for failed proxy requests + pub proxy_max_retries: u32, + /// Base backoff duration for proxy retries, in milliseconds + pub proxy_retry_backoff_base_ms: u64, /// timeout for environment verification, in milliseconds pub verify_env_timeout: u64, pub proxy_url: Option, @@ -143,6 +151,10 @@ impl Config { max_request_content_length: 10 * 1024 * 1024, // 10MB in Bytes trace_flush_interval: 3, stats_flush_interval: 3, + proxy_client_timeout: 30, + proxy_request_timeout: 30, + proxy_max_retries: 3, + proxy_retry_backoff_base_ms: 100, verify_env_timeout: 100, dd_dogstatsd_port, dd_site, diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 7d2ace78..0a15f432 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -29,14 +29,17 @@ impl ProxyFlusher { "Proxy Flusher | Creating new proxy flusher with target URL: {}", config.profiling_intake.url ); - let client = build_client(config.proxy_url.as_deref(), Duration::from_secs(30)) - .unwrap_or_else(|e| { - error!( - "Unable to parse proxy configuration: {}, no proxy will be used", - e - ); - reqwest::Client::new() - }); + let client = build_client( + config.proxy_url.as_deref(), + Duration::from_secs(config.proxy_client_timeout), + ) + .unwrap_or_else(|e| { + error!( + "Unable to parse proxy configuration: {}, no proxy will be used", + e + ); + reqwest::Client::new() + }); ProxyFlusher { config, client } } @@ -79,12 +82,14 @@ impl ProxyFlusher { .client .post(&request.target_url) .headers(headers) - .timeout(std::time::Duration::from_secs(30)) + .timeout(std::time::Duration::from_secs( + self.config.proxy_request_timeout, + )) .body(request.body.clone())) } async fn send_request(&self, request: ProxyRequest, api_key: &str) { - const MAX_RETRIES: u32 = 3; + let max_retries = self.config.proxy_max_retries; let mut attempts = 0; loop { @@ -100,7 +105,7 @@ impl ProxyFlusher { debug!( "Proxy Flusher | Sending request (attempt {}/{})", - attempts, MAX_RETRIES + attempts, max_retries ); let time = std::time::Instant::now(); @@ -123,23 +128,25 @@ impl ProxyFlusher { return; } Err(e) => { + // Only retry on network errors error!( "Proxy Flusher | Network error (attempt {}): {:?}", attempts, e ); - if attempts >= MAX_RETRIES { + if attempts >= max_retries { error!( "Proxy Flusher | Failed to send request after {} attempts: {:?}", attempts, e ); return; - }; + } + // Exponential backoff before retry + let backoff_ms = + self.config.proxy_retry_backoff_base_ms * (2_u64.pow(attempts - 1)); + debug!("Proxy Flusher | Retrying after {}ms backoff", backoff_ms); + tokio::time::sleep(Duration::from_millis(backoff_ms)).await; } } - // Exponential backoff - let backoff_ms = 100 * (2_u64.pow(attempts - 1)); - debug!("Proxy Flusher | Retrying after {}ms backoff", backoff_ms); - tokio::time::sleep(Duration::from_millis(backoff_ms)).await; } } } diff --git a/crates/dogstatsd/src/datadog.rs b/crates/dogstatsd/src/datadog.rs index 39b12baa..c65ba432 100644 --- a/crates/dogstatsd/src/datadog.rs +++ b/crates/dogstatsd/src/datadog.rs @@ -322,7 +322,7 @@ fn build_client( } if let Some(proxy) = https_proxy { - builder = builder.proxy(reqwest::Proxy::https(proxy)?); + builder = builder.proxy(reqwest::Proxy::all(proxy)?); } Ok(builder.build()?) } From 5eeefb3510b497ba7deff99b1891033d12666efa Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 17 Oct 2025 15:03:34 -0400 Subject: [PATCH 11/33] fix --- crates/datadog-trace-agent/src/trace_processor.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/datadog-trace-agent/src/trace_processor.rs b/crates/datadog-trace-agent/src/trace_processor.rs index 1c4cfa3b..8a052bea 100644 --- a/crates/datadog-trace-agent/src/trace_processor.rs +++ b/crates/datadog-trace-agent/src/trace_processor.rs @@ -188,6 +188,10 @@ mod tests { max_request_content_length: 10 * 1024 * 1024, trace_flush_interval: 3, stats_flush_interval: 3, + proxy_client_timeout: 30, + proxy_request_timeout: 30, + proxy_max_retries: 3, + proxy_retry_backoff_base_ms: 100, verify_env_timeout: 100, trace_intake: Endpoint { url: hyper::Uri::from_static("https://trace.agent.notdog.com/traces"), From f1ec0b859ab51a7acd475c664f1bd5eae79ae63b Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Mon, 27 Oct 2025 11:29:20 -0400 Subject: [PATCH 12/33] Reduce request timeout --- crates/datadog-trace-agent/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/datadog-trace-agent/src/config.rs b/crates/datadog-trace-agent/src/config.rs index 8a760835..370f1dff 100644 --- a/crates/datadog-trace-agent/src/config.rs +++ b/crates/datadog-trace-agent/src/config.rs @@ -152,7 +152,7 @@ impl Config { trace_flush_interval: 3, stats_flush_interval: 3, proxy_client_timeout: 30, - proxy_request_timeout: 30, + proxy_request_timeout: 5, proxy_max_retries: 3, proxy_retry_backoff_base_ms: 100, verify_env_timeout: 100, From a17218b52059bc5a590f14c0d15b7ac69efa0213 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Mon, 27 Oct 2025 15:06:41 -0400 Subject: [PATCH 13/33] Add rustls-tls --- crates/datadog-trace-agent/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/datadog-trace-agent/Cargo.toml b/crates/datadog-trace-agent/Cargo.toml index aaccf430..27ba088f 100644 --- a/crates/datadog-trace-agent/Cargo.toml +++ b/crates/datadog-trace-agent/Cargo.toml @@ -38,3 +38,6 @@ tempfile = "3.3.0" libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "435107c245112397914935c0f7148a18b91cafc6", features = [ "test-utils", ] } + +[features] +default = [ "reqwest/rustls-tls" ] \ No newline at end of file From 9818997f519560c8a40d9804279643748508a3ab Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Wed, 5 Nov 2025 15:51:55 -0500 Subject: [PATCH 14/33] Revert to original dogstatsd build_client function --- crates/datadog-trace-agent/src/http_utils.rs | 2 +- crates/dogstatsd/src/datadog.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/datadog-trace-agent/src/http_utils.rs b/crates/datadog-trace-agent/src/http_utils.rs index ba56cb39..e16a6ff1 100644 --- a/crates/datadog-trace-agent/src/http_utils.rs +++ b/crates/datadog-trace-agent/src/http_utils.rs @@ -122,7 +122,7 @@ pub fn build_client( ) -> Result> { let mut builder = create_reqwest_client_builder()?.timeout(timeout); if let Some(proxy) = proxy_url { - builder = builder.proxy(reqwest::Proxy::all(proxy)?); + builder = builder.proxy(reqwest::Proxy::https(proxy)?); } Ok(builder.build()?) } diff --git a/crates/dogstatsd/src/datadog.rs b/crates/dogstatsd/src/datadog.rs index c65ba432..39b12baa 100644 --- a/crates/dogstatsd/src/datadog.rs +++ b/crates/dogstatsd/src/datadog.rs @@ -322,7 +322,7 @@ fn build_client( } if let Some(proxy) = https_proxy { - builder = builder.proxy(reqwest::Proxy::all(proxy)?); + builder = builder.proxy(reqwest::Proxy::https(proxy)?); } Ok(builder.build()?) } From c23f3eb4ca46711eb3a46104dff201f6b839b560 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 7 Nov 2025 14:46:47 -0500 Subject: [PATCH 15/33] Add additional tags --- .../datadog-trace-agent/src/proxy_flusher.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 0a15f432..da0ae20a 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -12,6 +12,8 @@ use crate::config::Config; use crate::http_utils::build_client; use core::time::Duration; +const DD_ADDITIONAL_TAGS_HEADER: &str = "X-Datadog-Additional-Tags"; + pub struct ProxyRequest { pub headers: HeaderMap, pub body: Bytes, @@ -78,6 +80,23 @@ impl ProxyFlusher { Err(e) => return Err(format!("Failed to parse API key: {}", e)), }; + // Add additional Azure Function-specific tags + let mut tag_parts = vec![ + format!("_dd.origin:azure_functions"), + format!("functionname:{}", self.config.app_name.as_deref().unwrap_or_default()), + ]; + + // Append aas.* tags + for (key, value) in self.config.tags.tags() { + if key.starts_with("aas.") { + tag_parts.push(format!("{}:{}", key, value)); + } + } + + let additional_tags = tag_parts.join(";"); + debug!("Proxy Flusher | Adding profiling tags: {}", additional_tags); + headers.insert(DD_ADDITIONAL_TAGS_HEADER, additional_tags.parse().expect("Failed to parse additional tags header")); + Ok(self .client .post(&request.target_url) From a678f23c02e9168c58a7d6f7824b5c799851c671 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 7 Nov 2025 14:49:14 -0500 Subject: [PATCH 16/33] Formatting --- crates/datadog-trace-agent/src/proxy_flusher.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index da0ae20a..cd637af8 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -83,7 +83,10 @@ impl ProxyFlusher { // Add additional Azure Function-specific tags let mut tag_parts = vec![ format!("_dd.origin:azure_functions"), - format!("functionname:{}", self.config.app_name.as_deref().unwrap_or_default()), + format!( + "functionname:{}", + self.config.app_name.as_deref().unwrap_or_default() + ), ]; // Append aas.* tags @@ -95,7 +98,12 @@ impl ProxyFlusher { let additional_tags = tag_parts.join(";"); debug!("Proxy Flusher | Adding profiling tags: {}", additional_tags); - headers.insert(DD_ADDITIONAL_TAGS_HEADER, additional_tags.parse().expect("Failed to parse additional tags header")); + headers.insert( + DD_ADDITIONAL_TAGS_HEADER, + additional_tags + .parse() + .expect("Failed to parse additional tags header"), + ); Ok(self .client From 082e21c68ed5ee0bd9eb25ee52aaed5375d5eedb Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 7 Nov 2025 15:50:30 -0500 Subject: [PATCH 17/33] Avoid panicking --- crates/datadog-trace-agent/src/proxy_flusher.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index cd637af8..4c6627c6 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -98,12 +98,14 @@ impl ProxyFlusher { let additional_tags = tag_parts.join(";"); debug!("Proxy Flusher | Adding profiling tags: {}", additional_tags); - headers.insert( - DD_ADDITIONAL_TAGS_HEADER, - additional_tags - .parse() - .expect("Failed to parse additional tags header"), - ); + match additional_tags.parse() { + Ok(parsed_tags) => { + headers.insert(DD_ADDITIONAL_TAGS_HEADER, parsed_tags); + } + Err(e) => { + return Err(format!("Failed to parse additional tags header: {}", e)); + } + }; Ok(self .client From bf61041873a7ed492c49b2d0fa58e8e3ae10ed6c Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Mon, 10 Nov 2025 13:15:05 -0500 Subject: [PATCH 18/33] Add aas tags --- .../datadog-trace-agent/src/proxy_flusher.rs | 54 +++++++++++++++---- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 4c6627c6..0b7e4ea2 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -3,6 +3,7 @@ use bytes::Bytes; +use ddcommon::azure_app_services; use reqwest::header::HeaderMap; use std::sync::Arc; use tokio::sync::mpsc::Receiver; @@ -69,17 +70,13 @@ impl ProxyFlusher { api_key: &str, ) -> Result { let mut headers = request.headers.clone(); + debug!("Hello from proxy flusher create_request"); // Remove headers that are not needed for the proxy request headers.remove("host"); headers.remove("content-length"); // Add headers to the request - match api_key.parse() { - Ok(parsed_key) => headers.insert("DD-API-KEY", parsed_key), - Err(e) => return Err(format!("Failed to parse API key: {}", e)), - }; - // Add additional Azure Function-specific tags let mut tag_parts = vec![ format!("_dd.origin:azure_functions"), @@ -89,10 +86,34 @@ impl ProxyFlusher { ), ]; - // Append aas.* tags - for (key, value) in self.config.tags.tags() { - if key.starts_with("aas.") { - tag_parts.push(format!("{}:{}", key, value)); + // Add aas.* tags from Azure App Services metadata if available + if let Some(aas_metadata) = &*azure_app_services::AAS_METADATA { + let aas_tags = [ + ("aas.resource.id", aas_metadata.get_resource_id()), + ( + "aas.environment.extension_version", + aas_metadata.get_extension_version(), + ), + ( + "aas.environment.instance_id", + aas_metadata.get_instance_id(), + ), + ( + "aas.environment.instance_name", + aas_metadata.get_instance_name(), + ), + ("aas.environment.os", aas_metadata.get_operating_system()), + ("aas.resource.group", aas_metadata.get_resource_group()), + ("aas.site.name", aas_metadata.get_site_name()), + ("aas.site.kind", aas_metadata.get_site_kind()), + ("aas.site.type", aas_metadata.get_site_type()), + ("aas.subscription.id", aas_metadata.get_subscription_id()), + ]; + + for (name, value) in aas_tags { + if !value.is_empty() { + tag_parts.push(format!("{}:{}", name, value)); + } } } @@ -107,6 +128,20 @@ impl ProxyFlusher { } }; + debug!("Proxy Flusher | Final headers being sent:"); + for (name, value) in &headers { + if name.as_str().to_lowercase().contains("key") || name.as_str().to_lowercase().contains("token") || name.as_str().to_lowercase().contains("secret") { + continue; + } else { + debug!(" {}: {:?}", name, value); + } + } + + match api_key.parse() { + Ok(parsed_key) => headers.insert("DD-API-KEY", parsed_key), + Err(e) => return Err(format!("Failed to parse API key: {}", e)), + }; + Ok(self .client .post(&request.target_url) @@ -123,6 +158,7 @@ impl ProxyFlusher { loop { attempts += 1; + debug!("Proxy Flusher | Creating request. Gonna add tags"); let request_builder = match self.create_request(&request, api_key).await { Ok(builder) => builder, From 60499991b6352bc122c6597433a3930268496f52 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Mon, 10 Nov 2025 14:27:15 -0500 Subject: [PATCH 19/33] Fix aas tags --- .../datadog-trace-agent/src/proxy_flusher.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 0b7e4ea2..143c8196 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -87,13 +87,9 @@ impl ProxyFlusher { ]; // Add aas.* tags from Azure App Services metadata if available - if let Some(aas_metadata) = &*azure_app_services::AAS_METADATA { + if let Some(aas_metadata) = &*azure_app_services::AAS_METADATA_FUNCTION { let aas_tags = [ ("aas.resource.id", aas_metadata.get_resource_id()), - ( - "aas.environment.extension_version", - aas_metadata.get_extension_version(), - ), ( "aas.environment.instance_id", aas_metadata.get_instance_id(), @@ -102,12 +98,21 @@ impl ProxyFlusher { "aas.environment.instance_name", aas_metadata.get_instance_name(), ), + ("aas.subscription.id", aas_metadata.get_subscription_id()), ("aas.environment.os", aas_metadata.get_operating_system()), + ("aas.environment.runtime", aas_metadata.get_runtime()), + ( + "aas.environment.runtime_version", + aas_metadata.get_runtime_version(), + ), + ( + "aas.environment.function_runtime", + aas_metadata.get_function_runtime_version(), + ), ("aas.resource.group", aas_metadata.get_resource_group()), ("aas.site.name", aas_metadata.get_site_name()), ("aas.site.kind", aas_metadata.get_site_kind()), ("aas.site.type", aas_metadata.get_site_type()), - ("aas.subscription.id", aas_metadata.get_subscription_id()), ]; for (name, value) in aas_tags { @@ -115,6 +120,8 @@ impl ProxyFlusher { tag_parts.push(format!("{}:{}", name, value)); } } + } else { + debug!("Proxy Flusher | No Azure App Services metadata found"); } let additional_tags = tag_parts.join(";"); From 66d97a835e7e84f3d16444f2f060c1dac5b4b8a3 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Mon, 10 Nov 2025 15:10:18 -0500 Subject: [PATCH 20/33] Fix additional tags in profiles --- crates/datadog-trace-agent/src/proxy_flusher.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 143c8196..9ce81d97 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -76,8 +76,7 @@ impl ProxyFlusher { headers.remove("host"); headers.remove("content-length"); - // Add headers to the request - // Add additional Azure Function-specific tags + // Add headers to the request, including Azure Function-specific tags let mut tag_parts = vec![ format!("_dd.origin:azure_functions"), format!( @@ -124,8 +123,7 @@ impl ProxyFlusher { debug!("Proxy Flusher | No Azure App Services metadata found"); } - let additional_tags = tag_parts.join(";"); - debug!("Proxy Flusher | Adding profiling tags: {}", additional_tags); + let additional_tags = tag_parts.join(","); match additional_tags.parse() { Ok(parsed_tags) => { headers.insert(DD_ADDITIONAL_TAGS_HEADER, parsed_tags); @@ -135,15 +133,6 @@ impl ProxyFlusher { } }; - debug!("Proxy Flusher | Final headers being sent:"); - for (name, value) in &headers { - if name.as_str().to_lowercase().contains("key") || name.as_str().to_lowercase().contains("token") || name.as_str().to_lowercase().contains("secret") { - continue; - } else { - debug!(" {}: {:?}", name, value); - } - } - match api_key.parse() { Ok(parsed_key) => headers.insert("DD-API-KEY", parsed_key), Err(e) => return Err(format!("Failed to parse API key: {}", e)), From d8468705ae002eef4c317e58fb668a5ce05809dd Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Mon, 10 Nov 2025 15:30:41 -0500 Subject: [PATCH 21/33] Remove unnecessary debug logs --- crates/datadog-trace-agent/src/proxy_flusher.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 9ce81d97..3ba45589 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -70,7 +70,6 @@ impl ProxyFlusher { api_key: &str, ) -> Result { let mut headers = request.headers.clone(); - debug!("Hello from proxy flusher create_request"); // Remove headers that are not needed for the proxy request headers.remove("host"); @@ -154,7 +153,6 @@ impl ProxyFlusher { loop { attempts += 1; - debug!("Proxy Flusher | Creating request. Gonna add tags"); let request_builder = match self.create_request(&request, api_key).await { Ok(builder) => builder, From 299488d54bd943cb04b848472dfdefaf4c43897f Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Wed, 12 Nov 2025 11:33:39 -0500 Subject: [PATCH 22/33] Refactor --- .../datadog-trace-agent/src/proxy_flusher.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 3ba45589..56e8af43 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -75,16 +75,9 @@ impl ProxyFlusher { headers.remove("host"); headers.remove("content-length"); - // Add headers to the request, including Azure Function-specific tags - let mut tag_parts = vec![ - format!("_dd.origin:azure_functions"), - format!( - "functionname:{}", - self.config.app_name.as_deref().unwrap_or_default() - ), - ]; - + // Add headers to the request // Add aas.* tags from Azure App Services metadata if available + let mut tag_parts = vec![]; if let Some(aas_metadata) = &*azure_app_services::AAS_METADATA_FUNCTION { let aas_tags = [ ("aas.resource.id", aas_metadata.get_resource_id()), @@ -122,6 +115,13 @@ impl ProxyFlusher { debug!("Proxy Flusher | No Azure App Services metadata found"); } + // Add serverless-specific tags for profiling + tag_parts.push(format!( + "functionname:{}", + self.config.app_name.as_deref().unwrap_or_default() + )); + tag_parts.push("_dd.origin:azure_functions".to_string()); + let additional_tags = tag_parts.join(","); match additional_tags.parse() { Ok(parsed_tags) => { From b58e2d72ab63d5020be0e20836ea6416893fc94a Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Mon, 24 Nov 2025 18:44:19 -0500 Subject: [PATCH 23/33] Comment out aas.* tags for testing --- .../datadog-trace-agent/src/proxy_flusher.rs | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 56e8af43..049c700a 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -78,42 +78,42 @@ impl ProxyFlusher { // Add headers to the request // Add aas.* tags from Azure App Services metadata if available let mut tag_parts = vec![]; - if let Some(aas_metadata) = &*azure_app_services::AAS_METADATA_FUNCTION { - let aas_tags = [ - ("aas.resource.id", aas_metadata.get_resource_id()), - ( - "aas.environment.instance_id", - aas_metadata.get_instance_id(), - ), - ( - "aas.environment.instance_name", - aas_metadata.get_instance_name(), - ), - ("aas.subscription.id", aas_metadata.get_subscription_id()), - ("aas.environment.os", aas_metadata.get_operating_system()), - ("aas.environment.runtime", aas_metadata.get_runtime()), - ( - "aas.environment.runtime_version", - aas_metadata.get_runtime_version(), - ), - ( - "aas.environment.function_runtime", - aas_metadata.get_function_runtime_version(), - ), - ("aas.resource.group", aas_metadata.get_resource_group()), - ("aas.site.name", aas_metadata.get_site_name()), - ("aas.site.kind", aas_metadata.get_site_kind()), - ("aas.site.type", aas_metadata.get_site_type()), - ]; - - for (name, value) in aas_tags { - if !value.is_empty() { - tag_parts.push(format!("{}:{}", name, value)); - } - } - } else { - debug!("Proxy Flusher | No Azure App Services metadata found"); - } + // if let Some(aas_metadata) = &*azure_app_services::AAS_METADATA_FUNCTION { + // let aas_tags = [ + // ("aas.resource.id", aas_metadata.get_resource_id()), + // ( + // "aas.environment.instance_id", + // aas_metadata.get_instance_id(), + // ), + // ( + // "aas.environment.instance_name", + // aas_metadata.get_instance_name(), + // ), + // ("aas.subscription.id", aas_metadata.get_subscription_id()), + // ("aas.environment.os", aas_metadata.get_operating_system()), + // ("aas.environment.runtime", aas_metadata.get_runtime()), + // ( + // "aas.environment.runtime_version", + // aas_metadata.get_runtime_version(), + // ), + // ( + // "aas.environment.function_runtime", + // aas_metadata.get_function_runtime_version(), + // ), + // ("aas.resource.group", aas_metadata.get_resource_group()), + // ("aas.site.name", aas_metadata.get_site_name()), + // ("aas.site.kind", aas_metadata.get_site_kind()), + // ("aas.site.type", aas_metadata.get_site_type()), + // ]; + + // for (name, value) in aas_tags { + // if !value.is_empty() { + // tag_parts.push(format!("{}:{}", name, value)); + // } + // } + // } else { + // debug!("Proxy Flusher | No Azure App Services metadata found"); + // } // Add serverless-specific tags for profiling tag_parts.push(format!( From e5fec368c59b7303859ffa3b3b0444bc0be994d1 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Thu, 18 Dec 2025 11:43:50 -0500 Subject: [PATCH 24/33] Update license --- LICENSE-3rdparty.csv | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 81f1eb92..00f24509 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -22,9 +22,7 @@ camino,https://github.com/camino-rs/camino,MIT OR Apache-2.0,"Without Boats cc,https://github.com/rust-lang/cc-rs,MIT OR Apache-2.0,Alex Crichton -cexpr,https://github.com/jethrogb/rust-cexpr,Apache-2.0 OR MIT,Jethro Beekman cfg-if,https://github.com/rust-lang/cfg-if,MIT OR Apache-2.0,Alex Crichton -clang-sys,https://github.com/KyleMayes/clang-sys,Apache-2.0,Kyle Mayes concurrent-queue,https://github.com/smol-rs/concurrent-queue,Apache-2.0 OR MIT,"Stjepan Glavina , Taiki Endo , John Nunley " const_format,https://github.com/rodrimati1992/const_format_crates,Zlib,rodrimati1992 const_format_proc_macros,https://github.com/rodrimati1992/const_format_crates,Zlib,rodrimati1992 @@ -65,7 +63,6 @@ futures-timer,https://github.com/async-rs/futures-timer,MIT OR Apache-2.0,Alex C futures-util,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-util Authors generic-array,https://github.com/fizyk20/generic-array,MIT,"Bartłomiej Kamiński , Aaron Trent " getrandom,https://github.com/rust-random/getrandom,MIT OR Apache-2.0,The Rand Project Developers -glob,https://github.com/rust-lang/glob,MIT OR Apache-2.0,The Rust Project Developers h2,https://github.com/hyperium/h2,MIT,"Carl Lerche , Sean McArthur " hashbrown,https://github.com/rust-lang/hashbrown,MIT OR Apache-2.0,Amanieu d'Antras headers,https://github.com/hyperium/headers,MIT,Sean McArthur @@ -108,7 +105,6 @@ libdd-trace-normalization,https://github.com/DataDog/libdatadog/tree/main/libdd- libdd-trace-obfuscation,https://github.com/DataDog/libdatadog/tree/main/libdd-trace-obfuscation,Apache-2.0,Datadog Inc. libdd-trace-protobuf,https://github.com/DataDog/libdatadog/tree/main/libdd-trace-protobuf,Apache-2.0,The libdd-trace-protobuf Authors libdd-trace-utils,https://github.com/DataDog/libdatadog/tree/main/libdd-trace-utils,Apache-2.0,The libdd-trace-utils Authors -libloading,https://github.com/nagisa/rust_libloading,ISC,Simonas Kazlauskas linux-raw-sys,https://github.com/sunfishcode/linux-raw-sys,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Dan Gohman litemap,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers lock_api,https://github.com/Amanieu/parking_lot,MIT OR Apache-2.0,Amanieu d'Antras @@ -117,12 +113,10 @@ lru-slab,https://github.com/Ralith/lru-slab,MIT OR Apache-2.0 OR Zlib,Benjamin S matchers,https://github.com/hawkw/matchers,MIT,Eliza Weisman memchr,https://github.com/BurntSushi/memchr,Unlicense OR MIT,"Andrew Gallant , bluss" mime,https://github.com/hyperium/mime,MIT OR Apache-2.0,Sean McArthur -minimal-lexical,https://github.com/Alexhuszagh/minimal-lexical,MIT OR Apache-2.0,Alex Huszagh miniz_oxide,https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide,MIT OR Zlib OR Apache-2.0,"Frommi , oyvindln , Rich Geldreich richgel99@gmail.com" mio,https://github.com/tokio-rs/mio,MIT,"Carl Lerche , Thomas de Zeeuw , Tokio Contributors " multimap,https://github.com/havarnov/multimap,MIT OR Apache-2.0,Håvar Nøvik nix,https://github.com/nix-rust/nix,MIT,The nix-rust Project Developers -nom,https://github.com/Geal/nom,MIT,contact@geoffroycouprie.com nu-ansi-term,https://github.com/nushell/nu-ansi-term,MIT,"ogham@bsago.me, Ryan Scheel (Havvy) , Josh Triplett , The Nushell Project Developers" num-traits,https://github.com/rust-num/num-traits,MIT OR Apache-2.0,The Rust Project Developers once_cell,https://github.com/matklad/once_cell,MIT OR Apache-2.0,Aleksey Kladov @@ -195,7 +189,7 @@ serial_test_derive,https://github.com/palfrey/serial_test,MIT,Tom Parker-Shemilt sha1,https://github.com/RustCrypto/hashes,MIT OR Apache-2.0,RustCrypto Developers sharded-slab,https://github.com/hawkw/sharded-slab,MIT,Eliza Weisman shlex,https://github.com/comex/rust-shlex,MIT OR Apache-2.0,"comex , Fenhl , Adrian Taylor , Alex Touchet , Daniel Parks , Garrett Berg " -signal-hook-registry,https://github.com/vorner/signal-hook,Apache-2.0 OR MIT,"Michal 'vorner' Vaner , Masaki Hara " +signal-hook-registry,https://github.com/vorner/signal-hook,MIT OR Apache-2.0,"Michal 'vorner' Vaner , Masaki Hara " simd-adler32,https://github.com/mcountryman/simd-adler32,MIT,Marvin Countryman similar,https://github.com/mitsuhiko/similar,Apache-2.0,"Armin Ronacher , Pierre-Étienne Meunier , Brandon Williams " slab,https://github.com/tokio-rs/slab,MIT,Carl Lerche @@ -249,7 +243,6 @@ want,https://github.com/seanmonstar/want,MIT,Sean McArthur Date: Thu, 18 Dec 2025 11:51:31 -0500 Subject: [PATCH 25/33] Update tags --- .github/CODEOWNERS | 4 -- crates/datadog-trace-agent/src/mini_agent.rs | 6 +-- .../datadog-trace-agent/src/proxy_flusher.rs | 40 +------------------ 3 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 06979764..00000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,4 +0,0 @@ -* @DataDog/serverless-azure-and-gcp @DataDog/serverless-aws - -crates/datadog-serverless-compat/ @DataDog/serverless-azure-and-gcp -crates/datadog-trace-agent/ @DataDog/serverless-azure-and-gcp diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index 7cedf7d3..76bcb0c2 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -13,9 +13,9 @@ use std::time::Instant; use tokio::sync::mpsc::{self, Receiver, Sender}; use tracing::{debug, error}; -use crate::http_utils::{verify_request_content_length, log_and_create_http_response}; -use crate::proxy_flusher::{ProxyRequest, ProxyFlusher}; -use crate::{config, env_verifier, stats_flusher, stats_processor, trace_flusher, trace_processor }; +use crate::http_utils::{log_and_create_http_response, verify_request_content_length}; +use crate::proxy_flusher::{ProxyFlusher, ProxyRequest}; +use crate::{config, env_verifier, stats_flusher, stats_processor, trace_flusher, trace_processor}; use libdd_trace_protobuf::pb; use libdd_trace_utils::trace_utils; use libdd_trace_utils::trace_utils::SendData; diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 049c700a..1c846abe 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -3,7 +3,6 @@ use bytes::Bytes; -use ddcommon::azure_app_services; use reqwest::header::HeaderMap; use std::sync::Arc; use tokio::sync::mpsc::Receiver; @@ -76,51 +75,14 @@ impl ProxyFlusher { headers.remove("content-length"); // Add headers to the request - // Add aas.* tags from Azure App Services metadata if available let mut tag_parts = vec![]; - // if let Some(aas_metadata) = &*azure_app_services::AAS_METADATA_FUNCTION { - // let aas_tags = [ - // ("aas.resource.id", aas_metadata.get_resource_id()), - // ( - // "aas.environment.instance_id", - // aas_metadata.get_instance_id(), - // ), - // ( - // "aas.environment.instance_name", - // aas_metadata.get_instance_name(), - // ), - // ("aas.subscription.id", aas_metadata.get_subscription_id()), - // ("aas.environment.os", aas_metadata.get_operating_system()), - // ("aas.environment.runtime", aas_metadata.get_runtime()), - // ( - // "aas.environment.runtime_version", - // aas_metadata.get_runtime_version(), - // ), - // ( - // "aas.environment.function_runtime", - // aas_metadata.get_function_runtime_version(), - // ), - // ("aas.resource.group", aas_metadata.get_resource_group()), - // ("aas.site.name", aas_metadata.get_site_name()), - // ("aas.site.kind", aas_metadata.get_site_kind()), - // ("aas.site.type", aas_metadata.get_site_type()), - // ]; - - // for (name, value) in aas_tags { - // if !value.is_empty() { - // tag_parts.push(format!("{}:{}", name, value)); - // } - // } - // } else { - // debug!("Proxy Flusher | No Azure App Services metadata found"); - // } // Add serverless-specific tags for profiling tag_parts.push(format!( "functionname:{}", self.config.app_name.as_deref().unwrap_or_default() )); - tag_parts.push("_dd.origin:azure_functions".to_string()); + tag_parts.push("_dd.origin:azurefunction".to_string()); let additional_tags = tag_parts.join(","); match additional_tags.parse() { From 8fcf166515026d9e04b82bab80475547bdb817a0 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 26 Dec 2025 16:26:41 -0800 Subject: [PATCH 26/33] Respect DD_APM_PROFILING_DD_URL for profiling intake url override --- crates/datadog-trace-agent/src/config.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/datadog-trace-agent/src/config.rs b/crates/datadog-trace-agent/src/config.rs index 370f1dff..df5986c0 100644 --- a/crates/datadog-trace-agent/src/config.rs +++ b/crates/datadog-trace-agent/src/config.rs @@ -122,8 +122,6 @@ impl Config { let mut trace_intake_url = trace_intake_url(&dd_site); let mut trace_stats_intake_url = trace_stats_url(&dd_site); - let profiling_intake_url = format!("https://intake.profile.{}/api/v2/profile", dd_site); - // DD_APM_DD_URL env var will primarily be used for integration tests // overrides the entire trace/trace stats intake url prefix if let Ok(endpoint_prefix) = env::var("DD_APM_DD_URL") { @@ -131,6 +129,14 @@ impl Config { trace_stats_intake_url = trace_stats_url_prefixed(&endpoint_prefix); }; + // TODO: Create helper functions for this in libdatadog + let mut profiling_intake_url = format!("https://intake.profile.{}/api/v2/profile", dd_site); + // DD_APM_PROFILING_DD_URL env var will primarily be used for integration tests + // overrides the entire profiling intake url prefix + if let Ok(endpoint_prefix) = env::var("DD_APM_PROFILING_DD_URL") { + profiling_intake_url = format!("{endpoint_prefix}/api/v2/profile"); + }; + let obfuscation_config = obfuscation_config::ObfuscationConfig::new().map_err(|err| { anyhow::anyhow!( "Error creating obfuscation config, Mini Agent will not start. Error: {err}", From 9330986313ab5c0ff4c709ca3cb7b6a81fb23f8a Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Fri, 26 Dec 2025 17:01:55 -0800 Subject: [PATCH 27/33] Detect environment when setting _dd.origin tag --- crates/datadog-trace-agent/src/proxy_flusher.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 1c846abe..e14f0848 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -11,9 +11,19 @@ use tracing::{debug, error}; use crate::config::Config; use crate::http_utils::build_client; use core::time::Duration; +use libdd_trace_utils::trace_utils; const DD_ADDITIONAL_TAGS_HEADER: &str = "X-Datadog-Additional-Tags"; +/// Returns the appropriate _dd.origin value based on the environment type +fn get_dd_origin(env_type: &trace_utils::EnvironmentType) -> &'static str { + match env_type { + trace_utils::EnvironmentType::AzureFunction => "azurefunction", + trace_utils::EnvironmentType::CloudFunction => "cloudrun", + _ => "unknown", + } +} + pub struct ProxyRequest { pub headers: HeaderMap, pub body: Bytes, @@ -82,7 +92,10 @@ impl ProxyFlusher { "functionname:{}", self.config.app_name.as_deref().unwrap_or_default() )); - tag_parts.push("_dd.origin:azurefunction".to_string()); + tag_parts.push(format!( + "_dd.origin:{}", + get_dd_origin(&self.config.env_type) + )); let additional_tags = tag_parts.join(","); match additional_tags.parse() { From 9c17914a160a94e95e61a48d93223d87a5564dd9 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Mon, 29 Dec 2025 07:49:12 -0800 Subject: [PATCH 28/33] Enable default features for datadog-fips --- crates/datadog-trace-agent/Cargo.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/datadog-trace-agent/Cargo.toml b/crates/datadog-trace-agent/Cargo.toml index 27ba088f..3c8e5c99 100644 --- a/crates/datadog-trace-agent/Cargo.toml +++ b/crates/datadog-trace-agent/Cargo.toml @@ -26,7 +26,7 @@ libdd-trace-protobuf = { git = "https://github.com/DataDog/libdatadog", rev = "4 libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "435107c245112397914935c0f7148a18b91cafc6", features = [ "mini_agent", ] } -datadog-fips = { path = "../datadog-fips", default-features = false } +datadog-fips = { path = "../datadog-fips" } reqwest = { version = "0.12.23", features = ["json", "http2"], default-features = false } bytes = "1.10.1" @@ -38,6 +38,3 @@ tempfile = "3.3.0" libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "435107c245112397914935c0f7148a18b91cafc6", features = [ "test-utils", ] } - -[features] -default = [ "reqwest/rustls-tls" ] \ No newline at end of file From ebf47330fadcdefe44f3c74144258e2a5d799b3a Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Mon, 29 Dec 2025 09:11:16 -0800 Subject: [PATCH 29/33] Check for 202 success code --- crates/datadog-trace-agent/src/proxy_flusher.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index e14f0848..09cf062a 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -151,7 +151,7 @@ impl ProxyFlusher { let url = r.url().to_string(); let status = r.status(); let body = r.text().await; - if status == 202 || status == 200 { + if status == 202 { debug!( "Proxy Flusher | Successfully sent request in {} ms to {url}", elapsed.as_millis() From 0f671f792c50174d151ac9e0eb95a2c8e8f90f84 Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Tue, 6 Jan 2026 10:54:49 -0800 Subject: [PATCH 30/33] Make config variable names clearer --- crates/datadog-trace-agent/src/config.rs | 31 +++++++++---------- crates/datadog-trace-agent/src/http_utils.rs | 2 +- crates/datadog-trace-agent/src/mini_agent.rs | 2 +- .../datadog-trace-agent/src/proxy_flusher.rs | 8 ++--- .../datadog-trace-agent/src/stats_flusher.rs | 2 +- .../datadog-trace-agent/src/trace_flusher.rs | 5 ++- .../src/trace_processor.rs | 13 ++++---- 7 files changed, 31 insertions(+), 32 deletions(-) diff --git a/crates/datadog-trace-agent/src/config.rs b/crates/datadog-trace-agent/src/config.rs index df5986c0..0647dcec 100644 --- a/crates/datadog-trace-agent/src/config.rs +++ b/crates/datadog-trace-agent/src/config.rs @@ -81,23 +81,21 @@ pub struct Config { pub os: String, pub tags: Tags, /// how often to flush stats, in seconds - pub stats_flush_interval: u64, + pub stats_flush_interval_secs: u64, /// how often to flush traces, in seconds - pub trace_flush_interval: u64, + pub trace_flush_interval_secs: u64, pub trace_intake: Endpoint, pub trace_stats_intake: Endpoint, /// Profiling intake endpoint (for proxying profiling data to Datadog) pub profiling_intake: Endpoint, - /// HTTP client timeout for proxy requests, in milliseconds - pub proxy_client_timeout: u64, - /// Individual request timeout for proxy requests, in seconds - pub proxy_request_timeout: u64, + /// timeout for each proxy request, in seconds + pub proxy_request_timeout_secs: u64, /// Maximum number of retry attempts for failed proxy requests - pub proxy_max_retries: u32, - /// Base backoff duration for proxy retries, in milliseconds - pub proxy_retry_backoff_base_ms: u64, + pub proxy_request_max_retries: u32, + /// Base backoff duration for proxy request retries, in milliseconds + pub proxy_request_retry_backoff_base_ms: u64, /// timeout for environment verification, in milliseconds - pub verify_env_timeout: u64, + pub verify_env_timeout_ms: u64, pub proxy_url: Option, } @@ -155,13 +153,12 @@ impl Config { env_type, os: env::consts::OS.to_string(), max_request_content_length: 10 * 1024 * 1024, // 10MB in Bytes - trace_flush_interval: 3, - stats_flush_interval: 3, - proxy_client_timeout: 30, - proxy_request_timeout: 5, - proxy_max_retries: 3, - proxy_retry_backoff_base_ms: 100, - verify_env_timeout: 100, + trace_flush_interval_secs: 3, + stats_flush_interval_secs: 3, + proxy_request_timeout_secs: 30, + proxy_request_max_retries: 3, + proxy_request_retry_backoff_base_ms: 100, + verify_env_timeout_ms: 100, dd_dogstatsd_port, dd_site, trace_intake: Endpoint { diff --git a/crates/datadog-trace-agent/src/http_utils.rs b/crates/datadog-trace-agent/src/http_utils.rs index e16a6ff1..c330cf20 100644 --- a/crates/datadog-trace-agent/src/http_utils.rs +++ b/crates/datadog-trace-agent/src/http_utils.rs @@ -115,7 +115,7 @@ pub fn verify_request_content_length( } /// Builds a reqwest client with optional proxy configuration and timeout. -/// Uses FIPS-compliant TLS when the fips feature is enabled. +/// Uses rustls TLS by default. FIPS-compliant TLS is available via the fips feature pub fn build_client( proxy_url: Option<&str>, timeout: Duration, diff --git a/crates/datadog-trace-agent/src/mini_agent.rs b/crates/datadog-trace-agent/src/mini_agent.rs index 76bcb0c2..e7ec2576 100644 --- a/crates/datadog-trace-agent/src/mini_agent.rs +++ b/crates/datadog-trace-agent/src/mini_agent.rs @@ -47,7 +47,7 @@ impl MiniAgent { let mini_agent_metadata = Arc::new( self.env_verifier .verify_environment( - self.config.verify_env_timeout, + self.config.verify_env_timeout_ms, &self.config.env_type, &self.config.os, ) diff --git a/crates/datadog-trace-agent/src/proxy_flusher.rs b/crates/datadog-trace-agent/src/proxy_flusher.rs index 09cf062a..0d13cf8e 100644 --- a/crates/datadog-trace-agent/src/proxy_flusher.rs +++ b/crates/datadog-trace-agent/src/proxy_flusher.rs @@ -43,7 +43,7 @@ impl ProxyFlusher { ); let client = build_client( config.proxy_url.as_deref(), - Duration::from_secs(config.proxy_client_timeout), + Duration::from_secs(config.proxy_request_timeout_secs), ) .unwrap_or_else(|e| { error!( @@ -117,13 +117,13 @@ impl ProxyFlusher { .post(&request.target_url) .headers(headers) .timeout(std::time::Duration::from_secs( - self.config.proxy_request_timeout, + self.config.proxy_request_timeout_secs, )) .body(request.body.clone())) } async fn send_request(&self, request: ProxyRequest, api_key: &str) { - let max_retries = self.config.proxy_max_retries; + let max_retries = self.config.proxy_request_max_retries; let mut attempts = 0; loop { @@ -176,7 +176,7 @@ impl ProxyFlusher { } // Exponential backoff before retry let backoff_ms = - self.config.proxy_retry_backoff_base_ms * (2_u64.pow(attempts - 1)); + self.config.proxy_request_retry_backoff_base_ms * (2_u64.pow(attempts - 1)); debug!("Proxy Flusher | Retrying after {}ms backoff", backoff_ms); tokio::time::sleep(Duration::from_millis(backoff_ms)).await; } diff --git a/crates/datadog-trace-agent/src/stats_flusher.rs b/crates/datadog-trace-agent/src/stats_flusher.rs index fbadeda9..573bbeb0 100644 --- a/crates/datadog-trace-agent/src/stats_flusher.rs +++ b/crates/datadog-trace-agent/src/stats_flusher.rs @@ -47,7 +47,7 @@ impl StatsFlusher for ServerlessStatsFlusher { }); loop { - tokio::time::sleep(time::Duration::from_secs(config.stats_flush_interval)).await; + tokio::time::sleep(time::Duration::from_secs(config.stats_flush_interval_secs)).await; let mut buffer = buffer_consumer.lock().await; if !buffer.is_empty() { diff --git a/crates/datadog-trace-agent/src/trace_flusher.rs b/crates/datadog-trace-agent/src/trace_flusher.rs index c65fd4b8..29810eba 100644 --- a/crates/datadog-trace-agent/src/trace_flusher.rs +++ b/crates/datadog-trace-agent/src/trace_flusher.rs @@ -54,7 +54,10 @@ impl TraceFlusher for ServerlessTraceFlusher { }); loop { - tokio::time::sleep(time::Duration::from_secs(self.config.trace_flush_interval)).await; + tokio::time::sleep(time::Duration::from_secs( + self.config.trace_flush_interval_secs, + )) + .await; self.flush(None).await; } } diff --git a/crates/datadog-trace-agent/src/trace_processor.rs b/crates/datadog-trace-agent/src/trace_processor.rs index 8a052bea..433ee873 100644 --- a/crates/datadog-trace-agent/src/trace_processor.rs +++ b/crates/datadog-trace-agent/src/trace_processor.rs @@ -186,13 +186,12 @@ mod tests { Config { app_name: Some("dummy_function_name".to_string()), max_request_content_length: 10 * 1024 * 1024, - trace_flush_interval: 3, - stats_flush_interval: 3, - proxy_client_timeout: 30, - proxy_request_timeout: 30, - proxy_max_retries: 3, - proxy_retry_backoff_base_ms: 100, - verify_env_timeout: 100, + trace_flush_interval_secs: 3, + stats_flush_interval_secs: 3, + proxy_request_timeout_secs: 30, + proxy_request_max_retries: 3, + proxy_request_retry_backoff_base_ms: 100, + verify_env_timeout_ms: 100, trace_intake: Endpoint { url: hyper::Uri::from_static("https://trace.agent.notdog.com/traces"), api_key: Some("dummy_api_key".into()), From 4e2a124db75919fd1c40aab7d32d21d6597bd55f Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Tue, 6 Jan 2026 11:13:31 -0800 Subject: [PATCH 31/33] Update comment about DD_APM_PROFILING_DD_URL so that it is clearer it should be the prefix of the url --- crates/datadog-trace-agent/src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/datadog-trace-agent/src/config.rs b/crates/datadog-trace-agent/src/config.rs index 0647dcec..6274d56c 100644 --- a/crates/datadog-trace-agent/src/config.rs +++ b/crates/datadog-trace-agent/src/config.rs @@ -88,7 +88,7 @@ pub struct Config { pub trace_stats_intake: Endpoint, /// Profiling intake endpoint (for proxying profiling data to Datadog) pub profiling_intake: Endpoint, - /// timeout for each proxy request, in seconds + /// Timeout for each proxy request, in seconds pub proxy_request_timeout_secs: u64, /// Maximum number of retry attempts for failed proxy requests pub proxy_request_max_retries: u32, @@ -130,7 +130,7 @@ impl Config { // TODO: Create helper functions for this in libdatadog let mut profiling_intake_url = format!("https://intake.profile.{}/api/v2/profile", dd_site); // DD_APM_PROFILING_DD_URL env var will primarily be used for integration tests - // overrides the entire profiling intake url prefix + // overrides the prefix of the profiling intake url if let Ok(endpoint_prefix) = env::var("DD_APM_PROFILING_DD_URL") { profiling_intake_url = format!("{endpoint_prefix}/api/v2/profile"); }; From b749b9d0c533ae0fb2cc5d2493d4cf9c2d75ddbb Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Tue, 13 Jan 2026 13:58:05 -0500 Subject: [PATCH 32/33] Add codeowners file --- .github/CODEOWNERS | 4 ++++ Cargo.lock | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..06979764 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,4 @@ +* @DataDog/serverless-azure-and-gcp @DataDog/serverless-aws + +crates/datadog-serverless-compat/ @DataDog/serverless-azure-and-gcp +crates/datadog-trace-agent/ @DataDog/serverless-azure-and-gcp diff --git a/Cargo.lock b/Cargo.lock index 804e697d..d2e6803f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2121,6 +2121,15 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "rustls-pki-types" version = "1.13.2" From b33a25b6f6d0e56ea84ed732cf8180083504140f Mon Sep 17 00:00:00 2001 From: Kathie Huang Date: Tue, 13 Jan 2026 14:04:18 -0500 Subject: [PATCH 33/33] Fix license --- LICENSE-3rdparty.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 00f24509..f535588e 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -169,6 +169,7 @@ rustc-hash,https://github.com/rust-lang/rustc-hash,Apache-2.0 OR MIT,The Rust Pr rustix,https://github.com/bytecodealliance/rustix,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,"Dan Gohman , Jakub Konka " rustls,https://github.com/rustls/rustls,Apache-2.0 OR ISC OR MIT,The rustls Authors rustls-native-certs,https://github.com/rustls/rustls-native-certs,Apache-2.0 OR ISC OR MIT,The rustls-native-certs Authors +rustls-pemfile,https://github.com/rustls/pemfile,Apache-2.0 OR ISC OR MIT,The rustls-pemfile Authors rustls-pki-types,https://github.com/rustls/pki-types,MIT OR Apache-2.0,The rustls-pki-types Authors rustls-webpki,https://github.com/rustls/webpki,ISC,The rustls-webpki Authors rusty-fork,https://github.com/altsysrq/rusty-fork,MIT OR Apache-2.0,Jason Lingle