Skip to content
Merged
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
38 changes: 19 additions & 19 deletions Cargo.lock

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

13 changes: 10 additions & 3 deletions datadog-ipc/src/shm_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ use zwohash::ZwoHasher;

use libdd_ddsketch::DDSketch;
use libdd_trace_protobuf::pb;
use libdd_trace_stats::span_concentrator::{FixedAggregationKey, FlushableConcentrator};
use libdd_trace_stats::span_concentrator::{
FixedAggregationKey, FlushResult, FlushableConcentrator,
};

use crate::platform::{FileBackedHandle, MappedMem, NamedShmHandle};

Expand Down Expand Up @@ -820,8 +822,13 @@ impl ShmSpanConcentrator {
}

impl FlushableConcentrator for ShmSpanConcentrator {
fn flush_buckets(&mut self, force: bool) -> (Vec<pb::ClientStatsBucket>, u64) {
(self.drain_buckets(force), 0)
fn flush_buckets(&mut self, force: bool) -> FlushResult {
// The SHM concentrator does not perform client-side obfuscation.
FlushResult {
obfuscated_buckets: vec![],
unobfuscated_buckets: self.drain_buckets(force),
collapsed_spans: 0,
}
}
}

Expand Down
6 changes: 0 additions & 6 deletions datadog-sidecar/src/service/stats_flusher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ fn make_exporter(
s.meta.clone(),
endpoint,
NativeCapabilities::new_client(),
// Sidecar does not perform client-side stats obfuscation. Pass a disabled
// default so the `datadog-obfuscation-version` header is never sent.
#[cfg(feature = "stats-obfuscation")]
Arc::new(arc_swap::ArcSwap::from_pointee(
libdd_trace_stats::span_concentrator::StatsComputationObfuscationConfig::default(),
)),
#[cfg(feature = "stats-obfuscation")]
"0",
None,
Expand Down
Empty file removed libdd-data-pipeline/results.xml
Empty file.
2 changes: 1 addition & 1 deletion libdd-data-pipeline/src/otlp/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ pub struct OtlpStatsExporter<C: HttpClientCapability + SleepCapability> {
impl<C: HttpClientCapability + SleepCapability> OtlpStatsExporter<C> {
/// Flush the concentrator and export stats; returns `Ok(true)` if anything was sent.
async fn send(&self, force_flush: bool, max_retries: u32) -> anyhow::Result<bool> {
let (buckets, _collapsed_count) = {
let buckets = {
#[allow(clippy::unwrap_used)]
let mut c = self.concentrator.lock().unwrap();
c.flush_with_otlp_exact(SystemTime::now(), force_flush)
Expand Down
5 changes: 2 additions & 3 deletions libdd-data-pipeline/src/trace_exporter/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fn is_obfuscation_active(agent_info: &AgentInfo) -> bool {
agent_info
.info
.obfuscation_version
.is_some_and(|v| v >= 1 && v <= SUPPORTED_OBFUSCATION_VERSION)
.is_some_and(|v| v >= 1 && v == SUPPORTED_OBFUSCATION_VERSION)
}

#[cfg(not(target_arch = "wasm32"))]
Expand Down Expand Up @@ -170,8 +170,6 @@ fn create_and_start_stats_worker<
Endpoint::from_url(add_path(ctx.endpoint_url, STATS_ENDPOINT)),
capabilities.clone(),
#[cfg(feature = "stats-obfuscation")]
client_side_stats.obfuscation_config.clone(),
#[cfg(feature = "stats-obfuscation")]
SUPPORTED_OBFUSCATION_VERSION_STR,
#[cfg(feature = "telemetry")]
ctx.telemetry.clone(),
Expand Down Expand Up @@ -258,6 +256,7 @@ fn update_obfuscation_config(
) {
let obfuscation_active =
client_side_stats.obfuscation_enabled && is_obfuscation_active(agent_info);
// FIXME(APMSP-3720): there is more than this to obfuscation config
let sql_obfuscation_mode = (|| {
agent_info
.info
Expand Down
1 change: 1 addition & 0 deletions libdd-trace-stats/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ tokio = { version = "1.23", features = ["macros", "time"], default-features = fa
tokio-util = "0.7.11"
tracing = { version = "0.1", default-features = false }
async-trait = "0.1.85"
futures = { version = "0.3.32", default-features = false, features = ["alloc"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
libdd-capabilities-impl = { version = "3.0.0", path = "../libdd-capabilities-impl", default-features = false }
Expand Down
12 changes: 11 additions & 1 deletion libdd-trace-stats/src/span_concentrator/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,19 +431,29 @@ pub(super) struct StatsBucket {
max_entries: usize,
/// Number of spans collapsed into the overflow bucket due to cardinality limiting.
collapsed_count: u64,
/// Indicates if stats obfuscated in this bucket. This is set once at creation and stays
/// constant per bucket
#[cfg(feature = "stats-obfuscation")]
pub(super) obfuscated: bool,
}

impl StatsBucket {
/// Return a new StatsBucket starting at `start_timestamp`.
///
/// `max_entries` is the maximum number of distinct aggregation keys the bucket will hold.
/// Once the limit is reached, new distinct keys are collapsed into the overflow sentinel key.
pub(super) fn new(start_timestamp: u64, max_entries: usize) -> Self {
pub(super) fn new(
start_timestamp: u64,
max_entries: usize,
#[cfg(feature = "stats-obfuscation")] obfuscation_enabled: bool,
) -> Self {
Self {
data: HashMap::new(),
start: start_timestamp,
max_entries,
collapsed_count: 0,
#[cfg(feature = "stats-obfuscation")]
obfuscated: obfuscation_enabled,
}
}

Expand Down
Loading
Loading