Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions .vale/styles/config/vocabularies/technical/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ newtype
boolean(s?)
ddsketch
datadog
foldspace
otel
serde
stdin
Expand Down Expand Up @@ -95,6 +96,7 @@ inlining
cloneable
callsite
enqueue(s|d|ing)?
dequeue(s|d|ing)?
hostname
backpressure
misconfiguration
Expand Down
85 changes: 85 additions & 0 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ bitmask-enum = { version = "2.2", default-features = false }
facet = { version = "0.46.0", default-features = false, features = ["std"] }
figment = { version = "0.10", default-features = false }
foldhash = { version = "0.2", default-features = false, features = ["std"] }
foldspace-core = { git = "https://github.com/DataDog/foldspace", rev = "c585fd1fc09758eb61e133b0e4e023a01c82cb26" }
foldspace-patterns = { git = "https://github.com/DataDog/foldspace", rev = "c585fd1fc09758eb61e133b0e4e023a01c82cb26", features = ["core-adapter"] }
foldspace-server = { git = "https://github.com/DataDog/foldspace", rev = "c585fd1fc09758eb61e133b0e4e023a01c82cb26" }
headers = { version = "0.4", default-features = false }
http = { version = "1", default-features = false }
http-body = { version = "1", default-features = false }
Expand Down Expand Up @@ -164,6 +167,7 @@ similar-asserts = { version = "2.0", default-features = false }
slab = { version = "0.4.12", default-features = false }
syn = { version = "2", default-features = false, features = ["full", "parsing", "visit-mut"] }
tokio-util = { version = "0.7.18", default-features = false }
tokio-stream = { version = "0.1", default-features = false }
tower = { version = "0.5", default-features = false }
tracing-subscriber = { version = "0.3", default-features = false }
typify = { version = "0.7", default-features = false }
Expand Down Expand Up @@ -212,6 +216,7 @@ crossbeam-queue = { version = "0.3", default-features = false, features = [
"alloc",
] }
float-cmp = { version = "0.10", default-features = false }
flate2 = { version = "1", default-features = false, features = ["rust_backend"] }
tower-http = { version = "0.7", default-features = false }
bollard = { version = "0.21", default-features = false }
home = { version = "0.5", default-features = false }
Expand Down
8 changes: 8 additions & 0 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ flate2,https://github.com/rust-lang/flate2-rs,MIT OR Apache-2.0,"Alex Crichton <
float-cmp,https://github.com/mikedilger/float-cmp,MIT,Mike Dilger <mike@mikedilger.com>
fnv,https://github.com/servo/rust-fnv,Apache-2.0 OR MIT,Alex Crichton <alex@alexcrichton.com>
foldhash,https://github.com/orlp/foldhash,Zlib,Orson Peters <orsonpeters@gmail.com>
foldspace-core,https://github.com/DataDog/foldspace,Apache-2.0,The foldspace-core Authors
foldspace-eviction,https://github.com/DataDog/foldspace,Apache-2.0,The foldspace-eviction Authors
foldspace-patterns,https://github.com/DataDog/foldspace,Apache-2.0,The foldspace-patterns Authors
foldspace-patterns-tokenizer,https://github.com/DataDog/foldspace,Apache-2.0,The foldspace-patterns-tokenizer Authors
foldspace-server,https://github.com/DataDog/foldspace,Apache-2.0,The foldspace-server Authors
form_urlencoded,https://github.com/servo/rust-url,MIT OR Apache-2.0,The rust-url developers
fs4,https://github.com/al8n/fs4-rs,MIT OR Apache-2.0,"Dan Burkert <dan@danburkert.com>, Al Liu <scygliu1@gmail.com>"
futures,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures Authors
Expand Down Expand Up @@ -301,6 +306,8 @@ prost-types,https://github.com/tokio-rs/prost,Apache-2.0,"Dan Burkert <dan@danbu
protobuf,https://github.com/stepancheg/rust-protobuf,MIT,Stepan Koltsov <stepan.koltsov@gmail.com>
protobuf-parse,https://github.com/stepancheg/rust-protobuf/tree/master/protobuf-parse,MIT,Stepan Koltsov <stepan.koltsov@gmail.com>
protobuf-support,https://github.com/stepancheg/rust-protobuf,MIT,Stepan Koltsov <stepan.koltsov@gmail.com>
pulldown-cmark,https://github.com/raphlinus/pulldown-cmark,MIT,"Raph Levien <raph.levien@gmail.com>, Marcus Klaas de Vries <mail@marcusklaas.nl>"
pulldown-cmark-to-cmark,https://github.com/Byron/pulldown-cmark-to-cmark,Apache-2.0,"Sebastian Thiel <byronimo@gmail.com>, Dylan Owen <dyltotheo@gmail.com>, Alessandro Ogier <alessandro.ogier@gmail.com>, Zixian Cai <2891235+caizixian@users.noreply.github.com>, Andrew Lyjak <andrew.lyjak@gmail.com>"
quanta,https://github.com/metrics-rs/quanta,MIT,Toby Lawrence <toby@nuclearfurnace.com>
quick_cache,https://github.com/arthurprs/quick-cache,MIT,Arthur Silva <arthurprs@gmail.com>
quote,https://github.com/dtolnay/quote,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
Expand Down Expand Up @@ -455,6 +462,7 @@ typify-impl,https://github.com/oxidecomputer/typify,Apache-2.0,The typify-impl A
ucd-trie,https://github.com/BurntSushi/ucd-generate,MIT OR Apache-2.0,Andrew Gallant <jamslam@gmail.com>
unarray,https://github.com/cameron1024/unarray,MIT OR Apache-2.0,The unarray Authors
uncased,https://github.com/SergioBenitez/uncased,MIT OR Apache-2.0,Sergio Benitez <sb@sergio.bz>
unicase,https://github.com/seanmonstar/unicase,MIT OR Apache-2.0,Sean McArthur <sean@seanmonstar.com>
unicode-ident,https://github.com/dtolnay/unicode-ident,(MIT OR Apache-2.0) AND Unicode-3.0,David Tolnay <dtolnay@gmail.com>
unicode-segmentation,https://github.com/unicode-rs/unicode-segmentation,MIT OR Apache-2.0,"kwantam <kwantam@gmail.com>, Manish Goregaokar <manishsmail@gmail.com>"
unicode-width,https://github.com/unicode-rs/unicode-width,MIT OR Apache-2.0,"kwantam <kwantam@gmail.com>, Manish Goregaokar <manishsmail@gmail.com>"
Expand Down
3 changes: 2 additions & 1 deletion bin/agent-data-plane/src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ async fn create_topology(
&metrics_encoding,
&endpoints,
)
.error_context("Failed to configure Datadog forwarder.")?;
.error_context("Failed to configure Datadog forwarder.")?
.with_stateful_logs(config_system.config().domains.logs.stateful.clone());
blueprint.add_forwarder("dd_out", dd_forwarder_config)?;
}

Expand Down
5 changes: 5 additions & 0 deletions docs/agent-data-plane/configuration/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ The following settings are specific to ADP and have no equivalent in the core ag
| `dogstatsd_string_interner_size_bytes` | Explicit byte budget for context interner | |
| `dogstatsd_tcp_port` | TCP listen port for DSD | |
| `flush_timeout_secs` | Encoder flush timeout (secs) | |
| `logs_config.use_grpc` | Use stateful Foldspace transport for logs | false |
| `memory_limit` | Process memory limit | |
| `memory_slop_factor` | Memory accounting slop fraction | 0.25 |
| `otlp_allow_context_heap_allocs` | Allow heap allocations for OTLP contexts | |
Expand All @@ -470,6 +471,10 @@ The following settings are specific to ADP and have no equivalent in the core ag
| `otlp_string_interner_size` | OTLP context interner capacity | |
| `serializer_max_metrics_per_payload` | Max metrics per payload | |

### `logs_config.use_grpc`

Enables the initial stateful logs transport. Failed or queued stateful payloads are reconstructed and stored as complete stateless HTTP transactions before entering the normal retry or persisted queues. This does not provide full crash durability: a process crash before conversion can lose unacknowledged stateful payloads, and the persisted queue retains its existing dequeue crash window.

### `data_plane.otlp.receiver_grpc_endpoint_temporary`

Temporary development key for setting ADP's OTLP listen endpoints independently from the Agent's.
Expand Down
20 changes: 20 additions & 0 deletions lib/agent-data-plane-config-system/src/saluki_only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ pub struct SalukiOnly {
pub apm_config: ApmConfig,
/// OTLP receiver and trace knobs (`otlp_config.*`).
pub otlp_config: OtlpConfig,
/// Logs transport knobs (`logs_config.*`).
pub logs_config: LogsConfig,
/// OTTL span-drop filter (`ottl_filter_config`).
pub ottl_filter_config: Option<OttlFilterConfig>,
/// OTTL span-transform processor (`ottl_transform_config`).
Expand Down Expand Up @@ -213,6 +215,14 @@ pub struct DataPlaneChecks {
pub enabled: Option<bool>,
}

/// `logs_config.*` transport settings absent from the vendored Datadog schema.
#[derive(Clone, Debug, Default, Deserialize)]
#[serde(default)]
pub struct LogsConfig {
/// Whether stateful Foldspace transport is enabled (`logs_config.use_grpc`).
pub use_grpc: Option<bool>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could this be named more clearly? use_grpc does not imply, to me, enable_foldspace.

}

/// `apm_config.*` Saluki-only knobs. (The Datadog Agent publishes many other `apm_config.*` keys;
/// those are witnessed and ignored here.)
#[derive(Clone, Debug, Default, Deserialize)]
Expand Down Expand Up @@ -418,6 +428,11 @@ impl SalukiOnly {
config.shared.metrics_encoding.max_metrics_per_payload = v;
}

// domains.logs
if let Some(v) = self.logs_config.use_grpc {
config.domains.logs.stateful.enabled = v;
}

// domains.dogstatsd
let dsd = &mut config.domains.dogstatsd;
if let Some(v) = self.dogstatsd_tcp_port {
Expand Down Expand Up @@ -641,6 +656,7 @@ mod tests {
"ignore_missing_datadog_fields": true
}
},
"logs_config": { "use_grpc": true },
// top-level objects
"ottl_filter_config": { "error_mode": "ignore", "traces": { "span": ["attributes[\"a\"] == \"b\""] } },
"ottl_transform_config": { "error_mode": "silent", "trace_statements": ["set(name, \"x\")"] },
Expand All @@ -663,6 +679,9 @@ mod tests {
assert_eq!(config.shared.metrics_encoding.flush_timeout, Duration::from_secs(7));
assert_eq!(config.shared.metrics_encoding.max_metrics_per_payload, 999);

// domains.logs
assert!(config.domains.logs.stateful.enabled);

// domains.dogstatsd
let dsd = &config.domains.dogstatsd;
assert_eq!(dsd.listeners.tcp_port, 8126);
Expand Down Expand Up @@ -786,5 +805,6 @@ mod tests {
assert_eq!(otlp.receiver.grpc.endpoint, "localhost:6317");
assert_eq!(otlp.receiver.http.endpoint, "localhost:6318");
assert_eq!(otlp.traces.string_interner_size, DEFAULT_STRING_INTERNER_SIZE_BYTES);
assert!(!config.domains.logs.stateful.enabled);
}
}
19 changes: 19 additions & 0 deletions lib/agent-data-plane-config/src/domains/logs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//! Logs domain configuration.

use serde::Serialize;

/// Resolved logs configuration.
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
pub struct Domain {
/// Stateful Foldspace transport configuration.
pub stateful: StatefulEncoding,
}

/// Stateful Foldspace transport configuration.
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
pub struct StatefulEncoding {
/// Whether logs use stateful gRPC encoding.
///
/// Defaults to `false`. Enable this only when the configured logs intake supports Foldspace.
pub enabled: bool,
}
2 changes: 2 additions & 0 deletions lib/agent-data-plane-config/src/domains/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use serde::Serialize;

pub mod checks;
pub mod dogstatsd;
pub mod logs;
pub mod multi_region_failover;
pub mod otlp;
pub mod traces;
Expand All @@ -14,6 +15,7 @@ pub mod traces;
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
pub struct DomainConfiguration {
pub dogstatsd: dogstatsd::Domain,
pub logs: logs::Domain,
pub otlp: otlp::Domain,
pub traces: traces::Domain,
pub checks: checks::Domain,
Expand Down
21 changes: 21 additions & 0 deletions lib/datadog-agent/config-overlay-model/src/saluki_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ pub struct SalukiKey {
}

pub static SALUKI_KEYS: &[SalukiKey] = &[
// ── logs.rs ─────────────────────────────────────────────────────────────
SalukiKey {
yaml_path: "logs_config.use_grpc",
description: "Use stateful Foldspace transport for logs",
default: "false",
documentation: Some(
"Enables the initial stateful logs transport. Failed or queued stateful payloads are reconstructed and \
stored as complete stateless HTTP transactions before entering the normal retry or persisted queues. \
This does not provide full crash durability: a process crash before conversion can lose unacknowledged \
stateful payloads, and the persisted queue retains its existing dequeue crash window.",
),
value_type: "ValueType::Bool",
schema_default: Some("false"),
env_vars: &[],
env_var_override: None,
additional_yaml_paths: &[],
used_by: &["TYPED_CONFIG_SYSTEM"],
test_json: None,
pipeline_affinity: "PipelineAffinity::Pipelines(&[Pipeline::Checks, Pipeline::Otlp])",
filename: "logs.rs",
},
// ── data_plane.rs ────────────────────────────────────────────────────────
SalukiKey {
yaml_path: "data_plane.otlp.receiver_grpc_endpoint_temporary",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ mod dogstatsd_prefix_filter;
mod encoders;
mod forwarder;
mod get_typed;
mod logs;
mod mrf;
mod otlp;
mod proxy;
Expand All @@ -40,6 +41,7 @@ pub static SUPPORTED_ANNOTATIONS: LazyLock<Vec<&'static SalukiAnnotation>> = Laz
v.extend_from_slice(encoders::ALL);
v.extend_from_slice(forwarder::ALL);
v.extend_from_slice(get_typed::ALL);
v.extend_from_slice(logs::ALL);
v.extend_from_slice(mrf::ALL);
v.extend_from_slice(otlp::ALL);
v.extend_from_slice(proxy::ALL);
Expand Down
Loading
Loading