Skip to content
Closed
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
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion libdd-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ bench = false
[dependencies]
anyhow = "1.0"
futures = "0.3"
web-time = "1.1"
futures-core = { version = "0.3.0", default-features = false }
futures-util = { version = "0.3.0", default-features = false }
hex = "0.4"
Expand All @@ -41,13 +42,16 @@ regex = "1.5"
reqwest = { version = "0.13", features = ["rustls", "hickory-dns"], default-features = false, optional = true }
rustls-native-certs = { version = "0.8.1", optional = true }
thiserror = "1.0"
tokio = { version = "1.23", features = ["rt", "macros", "net", "io-util", "fs"] }
tokio = { version = "1.23", features = ["rt", "macros", "io-util", "time", "sync"] }
tokio-rustls = { version = "0.26", default-features = false, optional = true }
serde = { version = "1.0", features = ["derive"] }
static_assertions = "1.1.0"
libc = "0.2"
const_format = "0.2.34"
nix = { version = "0.29", features = ["process"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.23", features = ["rt-multi-thread", "net", "fs"] }

[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.52"
features = [
Expand Down Expand Up @@ -75,6 +79,9 @@ hyper-rustls = { version = "0.27", default-features = false, features = [
"ring",
], optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }

[dev-dependencies]
httparse = "1.9"
indexmap = "2.11"
Expand Down
3 changes: 3 additions & 0 deletions libdd-data-pipeline/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ autobenches = false
[dependencies]
anyhow = { version = "1.0" }
arc-swap = "1.7.1"
web-time = "1.1"
hyper = { workspace = true }
hyper-util = { workspace = true }
http = "1.1"
http-body-util = "0.1"
tracing = { version = "0.1", default-features = false }
Expand Down
7 changes: 6 additions & 1 deletion libdd-telemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ https = ["libdd-common/https"]
[dependencies]
anyhow = { version = "1.0" }
base64 = "0.22"
web-time = "1.1"
futures = { version = "0.3", default-features = false }
http-body-util = "0.1"
http = "1.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
sys-info = { version = "0.9.0" }
tokio = { version = "1.23", features = ["sync", "io-util"] }
tokio-util = { version = "0.7", features = ["codec"] }
tracing = { version = "0.1", default-features = false }
Expand All @@ -34,6 +34,11 @@ hashbrown = "0.15"
libdd-common = { version = "2.0.0", path = "../libdd-common", default-features = false }
libdd-ddsketch = { version = "1.0.1", path = "../libdd-ddsketch" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
sys-info = { version = "0.9.0" }

[target."cfg(unix)".dependencies]
libc = "0.2.176"

Expand Down
20 changes: 20 additions & 0 deletions libdd-telemetry/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,45 @@ pub mod os {
use std::ffi::CStr;

// TODO: this function will call API's (fargate, k8s, etc) in the future to get to real host API
#[cfg(not(target_arch = "wasm32"))]
pub fn real_hostname() -> anyhow::Result<String> {
Ok(sys_info::hostname()?)
}
#[cfg(target_arch = "wasm32")]
pub fn real_hostname() -> anyhow::Result<String> {
todo!("Node callback to query hostname")
}

pub const fn os_name() -> &'static str {
std::env::consts::OS
}

#[cfg(not(target_arch = "wasm32"))]
pub fn os_version() -> anyhow::Result<String> {
sys_info::os_release().map_err(|e| e.into())
}
#[cfg(target_arch = "wasm32")]
pub fn os_version() -> anyhow::Result<String> {
todo!("Node callback to query os version")
}

#[cfg(not(target_arch = "wasm32"))]
pub fn os_type() -> Option<String> {
sys_info::os_type().ok()
}
#[cfg(target_arch = "wasm32")]
pub fn os_type() -> Option<String> {
todo!("Node callback to query os type")
}

#[cfg(not(target_arch = "wasm32"))]
pub fn os_release() -> Option<String> {
sys_info::os_release().ok()
}
#[cfg(target_arch = "wasm32")]
pub fn os_release() -> Option<String> {
todo!("Node callback to query os release")
}

/// Get string similar to `uname -a`'s output
///
Expand Down
2 changes: 1 addition & 1 deletion libdd-telemetry/src/worker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ use std::{
atomic::{AtomicU64, Ordering},
Arc, Condvar, Mutex,
},
time,
};
use std::{collections::HashSet, fmt::Debug, time::Duration};
use web_time as time;

use crate::metrics::MetricBucketStats;
use futures::{
Expand Down
8 changes: 7 additions & 1 deletion libdd-trace-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rmp-serde = "1.1.1"
tracing = { version = "0.1", default-features = false }
serde_json = "1.0"
futures = { version = "0.3", default-features = false }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1", features = ["macros"] }
rand = "0.8.5"
bytes = "1.11.1"
rmpv = { version = "1.3.0", default-features = false }
Expand All @@ -55,6 +55,9 @@ httpmock = { version = "0.8.0-alpha.1", optional = true }
urlencoding = { version = "2.1.3", optional = true }
indexmap = "2.11"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1", features = ["rt-multi-thread"] }

[dev-dependencies]
bolero = "0.13"
criterion = "0.5.1"
Expand All @@ -78,3 +81,6 @@ test-utils = [
compression = ["zstd", "flate2"]
# FIPS mode uses the FIPS-compliant cryptographic provider (Unix only)
fips = ["libdd-common/fips"]

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
Loading