diff --git a/Cargo.lock b/Cargo.lock index 7b6b2db..63e9bcf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,9 +37,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "anyhow" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "arc-swap" @@ -298,6 +298,12 @@ dependencies = [ "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cexpr" version = "0.6.0" @@ -339,6 +345,16 @@ dependencies = [ "cc", ] +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "concurrent-queue" version = "2.5.0" @@ -492,7 +508,7 @@ name = "datadog-metrics-collector" version = "0.1.0" dependencies = [ "dogstatsd", - "libdd-common 4.2.0", + "libdd-common 5.0.0", "tokio", "tracing", "windows-sys 0.61.2", @@ -513,8 +529,8 @@ dependencies = [ "hyper-util", "libdd-common 2.0.1", "libdd-data-pipeline", - "libdd-telemetry", - "libdd-tinybytes 1.1.0", + "libdd-telemetry 3.0.0", + "libdd-tinybytes 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libdd-trace-utils 2.0.2", "lru", "opentelemetry", @@ -580,7 +596,7 @@ dependencies = [ "hyper-util", "libdd-capabilities", "libdd-capabilities-impl", - "libdd-common 4.2.0", + "libdd-common 5.0.0", "libdd-library-config", "libdd-trace-obfuscation", "libdd-trace-protobuf 3.0.2", @@ -1209,7 +1225,6 @@ dependencies = [ "hyper", "hyper-util", "rustls", - "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls", @@ -1406,6 +1421,50 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "jobserver" version = "0.1.34" @@ -1447,7 +1506,7 @@ checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" [[package]] name = "libdd-capabilities" version = "2.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "anyhow", "bytes", @@ -1458,13 +1517,13 @@ dependencies = [ [[package]] name = "libdd-capabilities-impl" version = "2.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "bytes", "http", "http-body-util", "libdd-capabilities", - "libdd-common 4.2.0", + "libdd-common 5.0.0", "tokio", ] @@ -1501,8 +1560,8 @@ dependencies = [ [[package]] name = "libdd-common" -version = "4.2.0" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +version = "5.0.0" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "anyhow", "bytes", @@ -1524,6 +1583,7 @@ dependencies = [ "regex", "rustls", "rustls-native-certs", + "rustls-platform-verifier", "serde", "static_assertions", "thiserror 1.0.69", @@ -1547,9 +1607,9 @@ dependencies = [ "http-body-util", "libdd-common 2.0.1", "libdd-ddsketch 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libdd-dogstatsd-client", - "libdd-telemetry", - "libdd-tinybytes 1.1.0", + "libdd-dogstatsd-client 1.0.1", + "libdd-telemetry 3.0.0", + "libdd-tinybytes 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libdd-trace-protobuf 2.0.0", "libdd-trace-stats 1.0.3", "libdd-trace-utils 2.0.2", @@ -1575,7 +1635,7 @@ dependencies = [ [[package]] name = "libdd-ddsketch" version = "1.0.1" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "prost 0.14.3", ] @@ -1594,10 +1654,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "libdd-dogstatsd-client" +version = "3.0.0" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" +dependencies = [ + "anyhow", + "cadence", + "http", + "libdd-common 5.0.0", + "serde", + "tracing", +] + [[package]] name = "libdd-library-config" version = "2.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "anyhow", "libc", @@ -1614,14 +1687,14 @@ dependencies = [ [[package]] name = "libdd-shared-runtime" version = "1.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "async-trait", "futures", "futures-util", "libdd-capabilities", "libdd-capabilities-impl", - "libdd-common 4.2.0", + "libdd-common 5.0.0", "tokio", "tokio-util", "tracing", @@ -1653,11 +1726,38 @@ dependencies = [ "winver", ] +[[package]] +name = "libdd-telemetry" +version = "5.0.1" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.22.1", + "bytes", + "futures", + "hashbrown 0.15.5", + "http", + "http-body-util", + "libc", + "libdd-common 5.0.0", + "libdd-ddsketch 1.0.1 (git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe)", + "libdd-shared-runtime", + "serde", + "serde_json", + "sys-info", + "tokio", + "tokio-util", + "tracing", + "uuid", + "winver", +] + [[package]] name = "libdd-tinybytes" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47838e12ae2665250b4cdba4e3119230b79e3c522bb9f48dd0c87346f5a8f44" +checksum = "97db80e3f3f9d19643ac444d6267951a5dab622ad9828c51149d49150625cfe8" dependencies = [ "serde", ] @@ -1665,7 +1765,7 @@ dependencies = [ [[package]] name = "libdd-tinybytes" version = "1.1.1" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "serde", ] @@ -1683,7 +1783,7 @@ dependencies = [ [[package]] name = "libdd-trace-normalization" version = "2.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "anyhow", "libdd-trace-protobuf 3.0.2", @@ -1692,11 +1792,11 @@ dependencies = [ [[package]] name = "libdd-trace-obfuscation" version = "4.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "anyhow", "fluent-uri", - "libdd-common 4.2.0", + "libdd-common 5.0.0", "libdd-trace-protobuf 3.0.2", "libdd-trace-utils 8.0.0", "log", @@ -1719,7 +1819,7 @@ dependencies = [ [[package]] name = "libdd-trace-protobuf" version = "3.0.2" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "prost 0.14.3", "serde", @@ -1741,7 +1841,7 @@ dependencies = [ [[package]] name = "libdd-trace-stats" version = "5.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "anyhow", "arc-swap", @@ -1750,9 +1850,11 @@ dependencies = [ "http", "libdd-capabilities", "libdd-capabilities-impl", - "libdd-common 4.2.0", - "libdd-ddsketch 1.0.1 (git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c)", + "libdd-common 5.0.0", + "libdd-ddsketch 1.0.1 (git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe)", + "libdd-dogstatsd-client 3.0.0", "libdd-shared-runtime", + "libdd-telemetry 5.0.1", "libdd-trace-obfuscation", "libdd-trace-protobuf 3.0.2", "libdd-trace-utils 8.0.0", @@ -1777,7 +1879,7 @@ dependencies = [ "http-body-util", "indexmap", "libdd-common 2.0.1", - "libdd-tinybytes 1.1.0", + "libdd-tinybytes 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libdd-trace-normalization 1.0.2", "libdd-trace-protobuf 2.0.0", "prost 0.14.3", @@ -1794,7 +1896,7 @@ dependencies = [ [[package]] name = "libdd-trace-utils" version = "8.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=a820699426f28cbabb3a74d87c7309d030b52e7c#a820699426f28cbabb3a74d87c7309d030b52e7c" +source = "git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe#def0a56d1686661e812c6fedb5902ad1cd28d8fe" dependencies = [ "anyhow", "base64 0.22.1", @@ -1804,6 +1906,7 @@ dependencies = [ "flate2", "futures", "getrandom 0.2.17", + "hex", "http", "http-body", "http-body-util", @@ -1812,8 +1915,8 @@ dependencies = [ "indexmap", "libdd-capabilities", "libdd-capabilities-impl", - "libdd-common 4.2.0", - "libdd-tinybytes 1.1.1", + "libdd-common 5.0.0", + "libdd-tinybytes 1.1.1 (git+https://github.com/DataDog/libdatadog?rev=def0a56d1686661e812c6fedb5902ad1cd28d8fe)", "libdd-trace-normalization 2.0.0", "libdd-trace-protobuf 3.0.2", "prost 0.14.3", @@ -1821,8 +1924,11 @@ dependencies = [ "rmp", "rmp-serde", "rmpv", + "rustc-hash", "serde", + "serde-transcode", "serde_json", + "thin-vec", "tokio", "tracing", "urlencoding", @@ -2766,6 +2872,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" version = "0.103.13" @@ -2802,6 +2935,15 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.29" @@ -2871,6 +3013,15 @@ dependencies = [ "serde_json", ] +[[package]] +name = "serde-transcode" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590c0e25c2a5bb6e85bf5c1bce768ceb86b316e7a01bdf07d2cb4ec2271990e2" +dependencies = [ + "serde", +] + [[package]] name = "serde-value" version = "0.7.0" @@ -3162,6 +3313,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "thin-vec" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0f7e269b48f0a7dd0146680fa24b50cc67fc0373f086a5b2f99bd084639b482" + [[package]] name = "thiserror" version = "1.0.69" @@ -3585,6 +3742,16 @@ dependencies = [ "libc", ] +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -3731,6 +3898,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-root-certs" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d46a5a140e6f7afeccd8eae97eff335163939eac8b929834875168b29b3d267" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "0.26.11" @@ -3761,6 +3937,15 @@ dependencies = [ "rustix 0.38.44", ] +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "windows" version = "0.48.0" @@ -3776,6 +3961,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -3812,6 +4006,21 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -3860,6 +4069,12 @@ dependencies = [ "windows_x86_64_msvc 0.53.1", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -3878,6 +4093,12 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -3896,6 +4117,12 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -3926,6 +4153,12 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -3944,6 +4177,12 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -3962,6 +4201,12 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -3980,6 +4225,12 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 9c0a9be..7e8f78d 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -30,9 +30,11 @@ 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 +cesu8,https://github.com/emk/cesu8-rs,Apache-2.0 OR MIT,Eric Kidd 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 +combine,https://github.com/Marwes/combine,MIT,Markus Westerlind 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 @@ -112,6 +114,10 @@ ipnet,https://github.com/krisprice/ipnet,MIT OR Apache-2.0,Kris Price 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 +jni,https://github.com/jni-rs/jni-rs,MIT OR Apache-2.0,Josh Chase +jni-sys,https://github.com/jni-rs/jni-sys,MIT OR Apache-2.0,Steven Fackler +jni-sys,https://github.com/jni-rs/jni-sys,MIT OR Apache-2.0,"Steven Fackler , Robert Bragg " +jni-sys-macros,https://github.com/jni-rs/jni-sys,MIT OR Apache-2.0,Robert Bragg jobserver,https://github.com/rust-lang/jobserver-rs,MIT OR Apache-2.0,Alex Crichton 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 @@ -209,10 +215,13 @@ rustix,https://github.com/bytecodealliance/rustix,Apache-2.0 WITH LLVM-exception 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-pki-types,https://github.com/rustls/pki-types,MIT OR Apache-2.0,The rustls-pki-types Authors +rustls-platform-verifier,https://github.com/rustls/rustls-platform-verifier,MIT OR Apache-2.0,The rustls-platform-verifier Authors +rustls-platform-verifier-android,https://github.com/rustls/rustls-platform-verifier,MIT OR Apache-2.0,The rustls-platform-verifier-android 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 +same-file,https://github.com/BurntSushi/same-file,Unlicense OR MIT,Andrew Gallant schannel,https://github.com/steffengy/schannel-rs,MIT,"Steven Fackler , Steffen Butzer " scopeguard,https://github.com/bluss/scopeguard,MIT OR Apache-2.0,bluss security-framework,https://github.com/kornelski/rust-security-framework,MIT OR Apache-2.0,"Steven Fackler , Kornel " @@ -220,6 +229,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-aux,https://github.com/iddm/serde-aux,MIT,Victor Polevoy +serde-transcode,https://github.com/sfackler/serde-transcode,MIT OR Apache-2.0,Steven Fackler serde-value,https://github.com/arcnmx/serde-value,MIT,arcnmx 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 " @@ -249,6 +259,7 @@ synstructure,https://github.com/mystor/synstructure,MIT,Nika Layzell tabwriter,https://github.com/BurntSushi/tabwriter,Unlicense OR MIT,Andrew Gallant tempfile,https://github.com/Stebalien/tempfile,MIT OR Apache-2.0,"Steven Allen , The Rust Project Developers, Ashley Mannix , Jason White " +thin-vec,https://github.com/mozilla/thin-vec,MIT OR Apache-2.0,Aria Beingessner thiserror,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay thiserror-impl,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay thread_local,https://github.com/Amanieu/thread_local-rs,MIT OR Apache-2.0,Amanieu d'Antras @@ -301,8 +312,10 @@ wasm-metadata,https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wa wasmparser,https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmparser,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Yury Delendik 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-root-certs,https://github.com/rustls/webpki-roots,CDLA-Permissive-2.0,The webpki-root-certs 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-util,https://github.com/BurntSushi/winapi-util,Unlicense OR MIT,Andrew Gallant windows,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 diff --git a/crates/datadog-agent-config/Cargo.toml b/crates/datadog-agent-config/Cargo.toml index 246f7f6..3ff15b2 100644 --- a/crates/datadog-agent-config/Cargo.toml +++ b/crates/datadog-agent-config/Cargo.toml @@ -6,8 +6,8 @@ license.workspace = true [dependencies] figment = { version = "0.10", default-features = false, features = ["yaml", "env"] } -libdd-trace-obfuscation = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c", default-features = false } -libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c", default-features = false } +libdd-trace-obfuscation = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe", default-features = false } +libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe", default-features = false } log = { version = "0.4", default-features = false } serde = { version = "1.0", default-features = false, features = ["derive"] } serde-aux = { version = "4.7", default-features = false } diff --git a/crates/datadog-metrics-collector/Cargo.toml b/crates/datadog-metrics-collector/Cargo.toml index 43774dd..e615a13 100644 --- a/crates/datadog-metrics-collector/Cargo.toml +++ b/crates/datadog-metrics-collector/Cargo.toml @@ -8,7 +8,7 @@ description = "Collector to read, compute, and submit enhanced metrics in Server [dependencies] dogstatsd = { path = "../dogstatsd", default-features = true } tracing = { version = "0.1", default-features = false } -libdd-common = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c", default-features = false } +libdd-common = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe", default-features = false } [target.'cfg(windows)'.dependencies] windows-sys = { version = "0.61", features = ["Win32_System_JobObjects"], optional = true, default-features = false } diff --git a/crates/datadog-serverless-compat/Cargo.toml b/crates/datadog-serverless-compat/Cargo.toml index a1ec609..f537fb6 100644 --- a/crates/datadog-serverless-compat/Cargo.toml +++ b/crates/datadog-serverless-compat/Cargo.toml @@ -14,7 +14,7 @@ windows-enhanced-metrics = ["datadog-metrics-collector/windows-enhanced-metrics" datadog-logs-agent = { path = "../datadog-logs-agent" } datadog-metrics-collector = { path = "../datadog-metrics-collector" } datadog-trace-agent = { path = "../datadog-trace-agent" } -libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c" } +libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe" } datadog-fips = { path = "../datadog-fips", default-features = false } dogstatsd = { path = "../dogstatsd", default-features = true } reqwest = { version = "0.12.4", default-features = false } diff --git a/crates/datadog-trace-agent/Cargo.toml b/crates/datadog-trace-agent/Cargo.toml index f197a6e..8e616ed 100644 --- a/crates/datadog-trace-agent/Cargo.toml +++ b/crates/datadog-trace-agent/Cargo.toml @@ -25,16 +25,16 @@ tracing = { version = "0.1", default-features = false } serde = { version = "1.0.145", features = ["derive"] } serde_json = "1.0" thiserror = { version = "1.0.58", default-features = false } -libdd-capabilities = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c" } -libdd-capabilities-impl = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c" } -libdd-common = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c" } -libdd-library-config = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c" } -libdd-trace-protobuf = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c" } -libdd-trace-stats = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c" } -libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c", features = [ +libdd-capabilities = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe" } +libdd-capabilities-impl = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe" } +libdd-common = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe" } +libdd-library-config = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe" } +libdd-trace-protobuf = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe" } +libdd-trace-stats = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe" } +libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe", features = [ "mini_agent", ] } -libdd-trace-obfuscation = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c" } +libdd-trace-obfuscation = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe" } datadog-fips = { path = "../datadog-fips" } reqwest = { version = "0.12.23", features = [ "json", @@ -49,6 +49,6 @@ serial_test = "2.0.0" duplicate = "2.0.1" temp-env = "0.3.6" tempfile = "3.3.0" -libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "a820699426f28cbabb3a74d87c7309d030b52e7c", features = [ +libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "def0a56d1686661e812c6fedb5902ad1cd28d8fe", features = [ "test-utils", ] } diff --git a/crates/datadog-trace-agent/src/config.rs b/crates/datadog-trace-agent/src/config.rs index 5be9fbe..f99dd41 100644 --- a/crates/datadog-trace-agent/src/config.rs +++ b/crates/datadog-trace-agent/src/config.rs @@ -115,6 +115,14 @@ pub struct Config { pub proxy_url: Option, pub env: String, pub peer_tags: Vec, + /// Gates additional_metric_tags and related config. + pub experimental_features_enabled: bool, + /// Tag keys extracted from spans and used as additional aggregation dimensions in stats. + /// Only populated when experimental_features_enabled is true. + pub additional_metric_tags: Vec, + /// Configures the per-bucket cardinality limit for additional_metric_tags stat entries. + /// Only populated when experimental_features_enabled is true. + pub additional_metric_tags_cardinality_limit: Option, /// Whether the agent should compute trace stats pub agent_stats_computation_enabled: bool, } @@ -216,6 +224,10 @@ impl Config { Tags::new() }; + let experimental_features_enabled = env::var("DD_TRACE_EXPERIMENTAL_FEATURES_ENABLED") + .map(|val| val.to_lowercase() == "true") + .unwrap_or(false); + #[allow(clippy::unwrap_used)] Ok(Config { app_name: Some(app_name), @@ -262,6 +274,30 @@ impl Config { tags, env: env::var("DD_ENV").unwrap_or_else(|_| "none".to_string()), peer_tags: peer_tag_keys()?, + experimental_features_enabled, + additional_metric_tags: if experimental_features_enabled { + env::var("DD_TRACE_STATS_ADDITIONAL_TAGS") + .ok() + .filter(|s| !s.is_empty()) + .map(|s| { + s.split(',') + .map(str::trim) + .filter(|s| !s.is_empty()) + .map(str::to_owned) + .collect() + }) + .unwrap_or_default() + } else { + vec![] + }, + additional_metric_tags_cardinality_limit: if experimental_features_enabled { + env::var("DD_TRACE_STATS_ADDITIONAL_TAGS_CARDINALITY_LIMIT") + .ok() + .and_then(|s| s.trim().parse::().ok()) + .filter(|&n| n > 0) + } else { + None + }, agent_stats_computation_enabled: env::var("DD_AGENT_STATS_COMPUTATION_ENABLED") .map(|val| val.to_lowercase() == "true") .unwrap_or(false), @@ -745,6 +781,53 @@ mod tests { }, ); } + + #[test] + #[serial] + fn test_additional_metric_tags_gated_by_experimental_flag() { + let base_vars = [ + ("DD_API_KEY", Some("_not_a_real_key_")), + ("FUNCTIONS_EXTENSION_VERSION", Some("~4")), + ("FUNCTIONS_WORKER_RUNTIME", Some("dotnet")), + ("WEBSITE_SITE_NAME", Some("my-azure-function")), + ("DD_TRACE_STATS_ADDITIONAL_TAGS", Some("region,tenant_id")), + ( + "DD_TRACE_STATS_ADDITIONAL_TAGS_CARDINALITY_LIMIT", + Some("50"), + ), + ]; + + temp_env::with_vars( + base_vars + .iter() + .cloned() + .chain([("DD_TRACE_EXPERIMENTAL_FEATURES_ENABLED", Some("false"))]) + .collect::>(), + || { + let config = config::Config::new().unwrap(); + assert!(!config.experimental_features_enabled); + assert!(config.additional_metric_tags.is_empty()); + assert_eq!(config.additional_metric_tags_cardinality_limit, None); + }, + ); + + temp_env::with_vars( + base_vars + .iter() + .cloned() + .chain([("DD_TRACE_EXPERIMENTAL_FEATURES_ENABLED", Some("true"))]) + .collect::>(), + || { + let config = config::Config::new().unwrap(); + assert!(config.experimental_features_enabled); + assert_eq!( + config.additional_metric_tags, + vec!["region".to_string(), "tenant_id".to_string()] + ); + assert_eq!(config.additional_metric_tags_cardinality_limit, Some(50)); + }, + ); + } } /// Test helpers for creating Config instances in tests @@ -782,6 +865,9 @@ pub mod test_helpers { proxy_url: None, env: "none".to_string(), peer_tags: peer_tag_keys().unwrap(), + experimental_features_enabled: false, + additional_metric_tags: vec![], + additional_metric_tags_cardinality_limit: None, agent_stats_computation_enabled: false, } } diff --git a/crates/datadog-trace-agent/src/stats_concentrator_service.rs b/crates/datadog-trace-agent/src/stats_concentrator_service.rs index 24eef1b..31107a1 100644 --- a/crates/datadog-trace-agent/src/stats_concentrator_service.rs +++ b/crates/datadog-trace-agent/src/stats_concentrator_service.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use std::collections::HashMap; +use std::hash::{Hash, Hasher}; use std::sync::Arc; use tokio::sync::{mpsc, oneshot}; @@ -61,9 +62,39 @@ impl StatsConcentratorHandle { } } +/// Wraps `Arc` so it can be used as a `HashMap` key. `TracerMetadata` only derives +/// `PartialEq` upstream in libdatadog, not `Eq` or `Hash`. All fields are `Eq` + `Hash`, +/// so hashing them field by field is consistent with equality. +#[derive(Debug, Clone)] +struct MetadataKey(Arc); + +impl PartialEq for MetadataKey { + fn eq(&self, other: &Self) -> bool { + self.0 == other.0 + } +} + +impl Eq for MetadataKey {} + +impl Hash for MetadataKey { + fn hash(&self, state: &mut H) { + let metadata = &*self.0; + metadata.schema_version.hash(state); + metadata.runtime_id.hash(state); + metadata.tracer_language.hash(state); + metadata.tracer_version.hash(state); + metadata.hostname.hash(state); + metadata.service_name.hash(state); + metadata.service_env.hash(state); + metadata.service_version.hash(state); + metadata.process_tags.hash(state); + metadata.container_id.hash(state); + } +} + pub struct StatsConcentratorService { /// One concentrator per unique TracerMetadata. - concentrators: HashMap, SpanConcentrator>, + concentrators: HashMap, rx: mpsc::UnboundedReceiver, config: Arc, } @@ -81,8 +112,12 @@ impl StatsConcentratorService { (service, handle) } - fn new_span_concentrator(peer_tags: Vec) -> SpanConcentrator { - SpanConcentrator::new( + fn new_span_concentrator( + peer_tags: Vec, + additional_metric_tags: Vec, + additional_metric_tags_cardinality_limit: Option, + ) -> SpanConcentrator { + let mut concentrator = SpanConcentrator::new( Duration::from_nanos(BUCKET_DURATION_NS), SystemTime::now(), SPAN_KINDS_STATS_COMPUTED @@ -90,7 +125,13 @@ impl StatsConcentratorService { .map(|s| s.to_string()) .collect(), peer_tags, - ) + None, + additional_metric_tags, + ); + if let Some(limit) = additional_metric_tags_cardinality_limit { + concentrator.set_additional_metric_tags_max_entries(limit); + } + concentrator } pub async fn run(mut self) { @@ -105,8 +146,14 @@ impl StatsConcentratorService { let config = Arc::clone(&self.config); let concentrator = self .concentrators - .entry(Arc::clone(&metadata)) - .or_insert_with(|| Self::new_span_concentrator(config.peer_tags.clone())); + .entry(MetadataKey(Arc::clone(&metadata))) + .or_insert_with(|| { + Self::new_span_concentrator( + config.peer_tags.clone(), + config.additional_metric_tags.clone(), + config.additional_metric_tags_cardinality_limit, + ) + }); for span in &chunk.spans { concentrator.add_span(span); @@ -127,8 +174,10 @@ impl StatsConcentratorService { let payloads = self .concentrators .iter_mut() - .filter_map(|(metadata, concentrator)| { - let stats_buckets = concentrator.flush(SystemTime::now(), force_flush); + .filter_map(|(key, concentrator)| { + let metadata = &key.0; + let (stats_buckets, _collapsed_spans) = + concentrator.flush(SystemTime::now(), force_flush); if stats_buckets.is_empty() { return None; } diff --git a/crates/datadog-trace-agent/src/trace_processor.rs b/crates/datadog-trace-agent/src/trace_processor.rs index 041153a..fbb1604 100644 --- a/crates/datadog-trace-agent/src/trace_processor.rs +++ b/crates/datadog-trace-agent/src/trace_processor.rs @@ -285,6 +285,9 @@ mod tests { tags: Tags::from_env_string("env:test,service:my-service"), env: "test-env".to_string(), peer_tags: peer_tag_keys().unwrap(), + experimental_features_enabled: false, + additional_metric_tags: vec![], + additional_metric_tags_cardinality_limit: None, agent_stats_computation_enabled: false, } } @@ -358,6 +361,7 @@ mod tests { env: "test-env".to_string(), hostname: "".to_string(), app_version: "".to_string(), + container_debug: None, }; let received_payload = @@ -436,6 +440,7 @@ mod tests { env: "test-env".to_string(), hostname: "".to_string(), app_version: "".to_string(), + container_debug: None, }; let received_payload =