Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
354 changes: 286 additions & 68 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ cc,https://github.com/rust-lang/cc-rs,MIT OR Apache-2.0,Alex Crichton <alex@alex
cesu8,https://github.com/emk/cesu8-rs,Apache-2.0 OR MIT,Eric Kidd <git@randomhacks.net>
cexpr,https://github.com/jethrogb/rust-cexpr,Apache-2.0 OR MIT,Jethro Beekman <jethro@jbeekman.nl>
cfg-if,https://github.com/alexcrichton/cfg-if,MIT OR Apache-2.0,Alex Crichton <alex@alexcrichton.com>
chacha20,https://github.com/RustCrypto/stream-ciphers,MIT OR Apache-2.0,RustCrypto Developers
chrono,https://github.com/chronotope/chrono,MIT OR Apache-2.0,The chrono Authors
ciborium,https://github.com/enarx/ciborium,Apache-2.0,Nathaniel McCallum <npmccallum@profian.com>
ciborium-io,https://github.com/enarx/ciborium,Apache-2.0,Nathaniel McCallum <npmccallum@profian.com>
Expand Down Expand Up @@ -199,6 +200,7 @@ icu_properties,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Projec
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
id-arena,https://github.com/fitzgen/id-arena,MIT OR Apache-2.0,"Nick Fitzgerald <fitzgen@gmail.com>, Aleksey Kladov <aleksey.kladov@gmail.com>"
ident_case,https://github.com/TedDriggs/ident_case,MIT OR Apache-2.0,Ted Driggs <ted.driggs@outlook.com>
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
Expand All @@ -219,6 +221,7 @@ js-sys,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/js-sys,MIT OR
kernel32-sys,https://github.com/retep998/winapi-rs,MIT,Peter Atashian <retep998@gmail.com>
kv-log-macro,https://github.com/yoshuawuyts/kv-log-macro,MIT OR Apache-2.0,Yoshua Wuyts <yoshuawuyts@gmail.com>
lazy_static,https://github.com/rust-lang-nursery/lazy-static.rs,MIT OR Apache-2.0,Marvin Löbel <loebel.marvin@gmail.com>
leb128fmt,https://github.com/bluk/leb128fmt,MIT OR Apache-2.0,Bryant Luk <code@bryantluk.com>
libc,https://github.com/rust-lang/libc,MIT OR Apache-2.0,The Rust Project Developers
libdd-libunwind-sys,https://github.com/DataDog/libdatadog/tree/main/libdd-libunwind-sys,Apache-2.0,The libdd-libunwind-sys Authors
libloading,https://github.com/nagisa/rust_libloading,ISC,Simonas Kazlauskas <libloading@kazlauskas.me>
Expand Down Expand Up @@ -327,6 +330,7 @@ r-efi,https://github.com/r-efi/r-efi,MIT OR Apache-2.0 OR LGPL-2.1-or-later,The
rand,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers"
rand_chacha,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers, The CryptoCorrosion Contributors"
rand_core,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers"
rand_core,https://github.com/rust-random/rand_core,MIT OR Apache-2.0,The Rand Project Developers
rand_xorshift,https://github.com/rust-random/rngs,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers"
rand_xoshiro,https://github.com/rust-random/rngs,MIT OR Apache-2.0,The Rand Project Developers
rayon,https://github.com/rayon-rs/rayon,MIT OR Apache-2.0,"Niko Matsakis <niko@alum.mit.edu>, Josh Stone <cuviper@gmail.com>"
Expand Down Expand Up @@ -487,12 +491,17 @@ walkdir,https://github.com/BurntSushi/walkdir,Unlicense OR MIT,Andrew Gallant <j
want,https://github.com/seanmonstar/want,MIT,Sean McArthur <sean@seanmonstar.com>
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
wasip2,https://github.com/bytecodealliance/wasi-rs,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The wasip2 Authors
wasip3,https://github.com/bytecodealliance/wasi-rs,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The wasip3 Authors
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
wasm-encoder,https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-encoder,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Nick Fitzgerald <fitzgen@gmail.com>
wasm-metadata,https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-metadata,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The wasm-metadata Authors
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 <ydelendik@mozilla.com>
web-sys,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys,MIT OR Apache-2.0,The wasm-bindgen Developers
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
Expand Down Expand Up @@ -524,7 +533,13 @@ windows_x86_64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Mi
winnow,https://github.com/winnow-rs/winnow,MIT,The winnow Authors
winreg,https://github.com/gentoo90/winreg-rs,MIT,Igor Shaula <gentoo90@gmail.com>
winver,https://github.com/rhysd/winver,MIT,rhysd <lin90162@yahoo.co.jp>
wit-bindgen,https://github.com/bytecodealliance/wit-bindgen,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Alex Crichton <alex@alexcrichton.com>
wit-bindgen-core,https://github.com/bytecodealliance/wit-bindgen,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Alex Crichton <alex@alexcrichton.com>
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
wit-bindgen-rust,https://github.com/bytecodealliance/wit-bindgen,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Alex Crichton <alex@alexcrichton.com>
wit-bindgen-rust-macro,https://github.com/bytecodealliance/wit-bindgen,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Alex Crichton <alex@alexcrichton.com>
wit-component,https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-component,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Peter Huene <peter@huene.dev>
wit-parser,https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-parser,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Alex Crichton <alex@alexcrichton.com>
write16,https://github.com/hsivonen/write16,Apache-2.0 OR MIT,The write16 Authors
writeable,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers
xattr,https://github.com/Stebalien/xattr,MIT OR Apache-2.0,Steven Allen <steven@stebalien.com>
Expand Down
5 changes: 3 additions & 2 deletions bin_tests/tests/crashtracker_bin_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ use bin_tests::{
validation::PayloadValidator,
ArtifactsBuild, BuildProfile,
};
#[cfg(target_os = "linux")]
use libdd_crashtracker::default_max_threads;
use libdd_crashtracker::{
default_max_threads, CrashtrackerConfiguration, Metadata, SiCodes, SigInfo, SignalNames,
StacktraceCollection,
CrashtrackerConfiguration, Metadata, SiCodes, SigInfo, SignalNames, StacktraceCollection,
};
use serde_json::Value;

Expand Down
2 changes: 1 addition & 1 deletion datadog-sidecar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ http-body-util = "0.1"
datadog-ipc = { path = "../datadog-ipc", features = ["tiny-bytes"] }
datadog-ipc-macros = { path = "../datadog-ipc-macros" }

rand = "0.8.3"
rand = "0.10.1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep rand below the workspace MSRV

When the CI matrix runs with Rust 1.84.1 (.github/workflows/test.yml and lint.yml) this dependency bump makes Cargo reject the build before compiling, because rand 0.10.1 declares rust-version = "1.85" while the workspace still advertises rust-version = "1.84.1" in the root Cargo.toml. Unless the workspace MSRV and CI are bumped together, every crate that now depends on rand = "0.10.1" will fail in the 1.84.1 jobs.

Useful? React with 👍 / 👎.

rmp-serde = "1.1.1"
libdd-trace-protobuf = { path = "../libdd-trace-protobuf" }
serde = { version = "1.0", features = ["derive", "rc"] }
Expand Down
4 changes: 2 additions & 2 deletions datadog-sidecar/src/service/queue_id.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0

use rand::Rng;
use rand::RngExt as _;
use serde::{Deserialize, Serialize};

/// `QueueId` is a struct that represents a unique identifier for a queue.
Expand All @@ -27,7 +27,7 @@ impl QueueId {
/// ```
pub fn new_unique() -> Self {
Self {
inner: rand::thread_rng().gen_range(1u64..u64::MAX),
inner: rand::rng().random_range(1u64..u64::MAX),
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions datadog-sidecar/src/setup/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ mod tests {

#[test]
fn test_shared_dir_can_connect_to_socket() -> anyhow::Result<()> {
use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
let random_prefix: Vec<u8> = thread_rng().sample_iter(&Alphanumeric).take(8).collect();
use rand::distr::Alphanumeric;
use rand::RngExt;
let random_prefix: Vec<u8> = rand::rng().sample_iter(&Alphanumeric).take(8).collect();
let liaison = super::NamedPipeLiaison::new(String::from_utf8_lossy(&random_prefix));
basic_liaison_connection_test(&liaison)?;
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions libdd-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mime = { version = "0.3.16", optional = true }
multer = { version = "3.1", optional = true }
bytes = { version = "1.11.1" }
pin-project = "1"
rand = { version = "0.8", optional = true }
rand = { version = "0.10.1", optional = true }
regex = "1.5"
regex-lite = { version = "0.1", optional = true }
# Use hickory-dns instead of the default system DNS resolver to avoid fork safety issues.
Expand Down Expand Up @@ -85,7 +85,7 @@ maplit = "1.0"
mime = "0.3.16"
multer = "3.1"
bytes = "1.11.1"
rand = "0.8"
rand = "0.10.1"
tempfile = "3.8"
tokio = { version = "1.23", features = ["rt", "macros", "time"] }

Expand Down
2 changes: 1 addition & 1 deletion libdd-crashtracker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ num-traits = "0.2.19"
os_info = "3.14.0"
page_size = "0.6.0"
portable-atomic = { version = "1.6.0", features = ["serde"] }
rand = "0.8.5"
rand = "0.10.1"
schemars = "0.8.21"
serde = {version = "1.0", features = ["derive"]}
serde_json = {version = "1.0"}
Expand Down
6 changes: 3 additions & 3 deletions libdd-crashtracker/src/collector/atomic_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! If this is useful for other cases, we can consider moving it to ddcommon.

use portable_atomic::AtomicUsize;
use rand::Rng;
use rand::RngExt as _;
use std::fmt::Debug;
use std::io::Write;
use std::num::NonZeroU128;
Expand Down Expand Up @@ -141,7 +141,7 @@ where
// Long scans become exponentially unlikely, giving amortized constant time insertion.
// Try 10 random locations, this should succeed 0.999 of the time.
for _ in 0..10 {
let idx: usize = rand::thread_rng().gen_range(0..self.set.len());
let idx: usize = rand::rng().random_range(0..self.set.len());
if let Some(v) = self.set[idx].try_insert(value) {
value = v;
} else {
Expand All @@ -152,7 +152,7 @@ where
// In the case where it doesn't succeed, do a linear probe to guarantee it lands somewhere.
// Since we enforce that the array is only half full, this is guarantee to succeed.
// We leave this to second to avoid the chains that can build up with linear probing.
let shift: usize = rand::thread_rng().gen_range(0..self.set.len());
let shift: usize = rand::rng().random_range(0..self.set.len());
for i in 0..self.set.len() {
let idx = (i + shift) % self.set.len();

Expand Down
4 changes: 2 additions & 2 deletions libdd-crashtracker/src/receiver/receive_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::{
crash_info::{
CrashInfo, CrashInfoBuilder, ErrorKind, SigInfo, Span, StackFrame, TelemetryCrashUploader,
Threads, Ucontext,
Ucontext,
},
runtime_callback::RuntimeStack,
shared::constants::*,
Expand Down Expand Up @@ -560,7 +560,7 @@ fn collect_and_add_thread_contexts(
crashing_tid: Option<u32>,
budget: Duration,
) -> anyhow::Result<()> {
use crate::crash_info::ThreadData;
use crate::crash_info::{ThreadData, Threads};
use crate::receiver::ptrace_collector::stream_thread_contexts;

let crashing_tid = crashing_tid.unwrap_or(0) as i32;
Expand Down
3 changes: 2 additions & 1 deletion libdd-data-pipeline/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ libdd-capabilities-impl = { version = "1.0.0", path = "../libdd-capabilities-imp

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
getrandom_v04 = { package = "getrandom", version = "0.4", features = ["wasm_js"] }
uuid = { version = "1", features = ["js"] }

[lib]
Expand All @@ -71,7 +72,7 @@ libdd-trace-utils = { path = "../libdd-trace-utils", features = [
"test-utils",
] }
httpmock = "0.8.0-alpha.1"
rand = "0.8.5"
rand = "0.10.1"
tempfile = "3.3.0"
tokio = { version = "1.23", features = [
"rt",
Expand Down
2 changes: 1 addition & 1 deletion libdd-library-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ serde_yaml = "0.9.34"
prost = "0.14.1"
anyhow = "1.0"

rand = "0.8.3"
rand = "0.10.1"
rmp = "0.8.14"
rmp-serde = "1.3.0"

Expand Down
6 changes: 3 additions & 3 deletions libdd-library-config/src/tracer_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ pub enum AnonymousFileHandle {
#[cfg(target_os = "linux")]
mod linux {
use anyhow::Context;
use rand::distributions::Alphanumeric;
use rand::Rng;
use rand::distr::Alphanumeric;
use rand::RngExt;
use std::io::Write;

/// Create a memfd file storing the tracer metadata. This function also attempts to publish the
Expand All @@ -186,7 +186,7 @@ mod linux {
) -> anyhow::Result<super::AnonymousFileHandle> {
let _ = crate::otel_process_ctx::linux::publish(&data.to_otel_process_ctx());

let uid: String = rand::thread_rng()
let uid: String = rand::rng()
.sample_iter(&Alphanumeric)
.take(8)
.map(char::from)
Expand Down
2 changes: 1 addition & 1 deletion libdd-profiling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ libdd-profiling-protobuf = { version = "2.0.0", path = "../libdd-profiling-proto
mime = "0.3.16"
parking_lot = { version = "0.12", default-features = false }
prost = "0.14.1"
rand = "0.8"
rand = "0.10.1"
# Use rustls to align with the rest of the workspace (libdd-common, libdd-telemetry, etc.)
# Non-FIPS builds use ring as the crypto provider; FIPS builds use aws-lc-rs.
# Use hickory-dns instead of the default system DNS resolver to avoid fork safety issues.
Expand Down
2 changes: 1 addition & 1 deletion libdd-trace-normalization/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ arbitrary = { version = "1.3", features = ["derive"], optional = true }
fuzzing = ["arbitrary"]

[dev-dependencies]
rand = "0.8.5"
rand = "0.10.1"
duplicate = "0.4.1"
criterion = "0.5"

Expand Down
6 changes: 3 additions & 3 deletions libdd-trace-normalization/src/normalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,20 @@ mod tests {
use crate::normalize_utils::{DEFAULT_SPAN_NAME, MAX_TYPE_LEN};
use crate::normalizer;
use libdd_trace_protobuf::pb;
use rand::Rng;
use rand::RngExt;
use std::collections::HashMap;
use std::time::SystemTime;

fn new_test_span() -> pb::Span {
let mut rng = rand::thread_rng();
let mut rng = rand::rng();

pb::Span {
duration: 10000000,
error: 0,
resource: "GET /some/raclette".to_string(),
service: "django".to_string(),
name: "django.controller".to_string(),
span_id: rng.gen(),
span_id: rng.random(),
start: 1448466874000000000,
trace_id: 424242,
meta: HashMap::from([
Expand Down
2 changes: 1 addition & 1 deletion libdd-trace-stats/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ path = "benches/main.rs"
criterion = "0.5.1"
httpmock = "0.8.0-alpha.1"
libdd-trace-utils = { path = "../libdd-trace-utils", features = ["test-utils"] }
rand = "0.8.5"
rand = "0.10.1"
tokio = { version = "1.23", features = ["rt-multi-thread", "macros", "test-util", "time"], default-features = false }

[features]
Expand Down
4 changes: 2 additions & 2 deletions libdd-trace-stats/src/span_concentrator/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::span_concentrator::aggregation::OwnedAggregationKey;

use super::*;
use libdd_trace_utils::span::{trace_utils::compute_top_level_span, v04::SpanSlice};
use rand::{thread_rng, Rng};
use rand::RngExt;

const BUCKET_SIZE: u64 = Duration::from_secs(2).as_nanos() as u64;

Expand All @@ -20,7 +20,7 @@ fn get_span_kinds() -> Vec<String> {

/// Return a random timestamp within the corresponding bucket (now - offset)
fn get_timestamp_in_bucket(aligned_now: u64, bucket_size: u64, offset: u64) -> u64 {
aligned_now - bucket_size * offset + thread_rng().gen_range(0..BUCKET_SIZE)
aligned_now - bucket_size * offset + rand::rng().random_range(0..BUCKET_SIZE)
}

/// Create a test span with given attributes
Expand Down
2 changes: 1 addition & 1 deletion libdd-trace-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tracing = { version = "0.1", default-features = false }
serde_json = "1.0"
futures = { version = "0.3", default-features = false }
tokio = { version = "1", features = ["macros"] }
rand = "0.8.5"
rand = "0.10.1"
bytes = "1.11.1"
rmpv = { version = "1.3.0", default-features = false }
rmp = { version = "0.8.14", default-features = false }
Expand Down
Loading