agent_data_plane_config/
defaults.rs

1//! This is a place for re-usable Saluki-only defaults.
2//!
3//! Important: this is *not* a place where we should restate Datadog Agent schema-derived defaults.
4//! Defaults that flow from the Datadog schema are defined by codegen in the appropriate crate. We
5//! only want the definitive codegen defaults rather than restating values that can drift (see
6//! #1802).
7
8use std::{
9    num::{NonZeroU64, NonZeroUsize},
10    time::Duration,
11};
12
13/// Default Checks IPC endpoint.
14pub const DEFAULT_CHECKS_IPC_ENDPOINT: &str = "tcp://0.0.0.0:5105";
15
16/// Default length of an aggregation window.
17pub const DEFAULT_AGGREGATE_WINDOW_DURATION_SECONDS: NonZeroU64 = NonZeroU64::new(10).unwrap();
18
19/// Default maximum number of contexts held per aggregation window.
20pub const DEFAULT_AGGREGATE_CONTEXT_LIMIT: usize = 1_000_000;
21
22/// Default period between aggregation flushes.
23pub const DEFAULT_AGGREGATE_FLUSH_INTERVAL: Duration = Duration::from_secs(15);
24
25/// Default delay before an idle passthrough buffer is flushed.
26pub const DEFAULT_AGGREGATE_PASSTHROUGH_IDLE_FLUSH_TIMEOUT: Duration = Duration::from_secs(1);
27
28/// Default timeout before a partially filled encoder payload is flushed.
29pub const DEFAULT_ENCODER_FLUSH_TIMEOUT: Duration = Duration::from_secs(2);
30
31/// Default zstd compression level for payloads ADP sends.
32///
33/// Higher than the Agent's default of `1` because ADP compresses more efficiently and can afford
34/// better compression: level 3 yields ~6% smaller payloads without a net CPU increase.
35pub const DEFAULT_ZSTD_COMPRESSOR_LEVEL: i32 = 3;
36
37/// Default maximum number of metrics packed into a single encoder payload.
38pub const DEFAULT_MAX_METRICS_PER_PAYLOAD: usize = 10_000;
39
40/// Default environment for traces that do not provide one.
41pub const DEFAULT_TRACE_ENV: &str = "none";
42
43/// Whether error traces are sampled independently of the base sampler by default.
44pub const DEFAULT_ERROR_SAMPLING_ENABLED: bool = true;
45
46/// Default rare-sampler traces-per-second budget.
47pub const DEFAULT_RARE_SAMPLER_TPS: f64 = 5.0;
48
49/// Default rare-sampler cooldown, in seconds.
50pub const DEFAULT_RARE_SAMPLER_COOLDOWN_SECS: f64 = 300.0;
51
52/// Default rare-sampler signature cardinality.
53pub const DEFAULT_RARE_SAMPLER_CARDINALITY: usize = 200;
54
55/// Default OTLP trace string interner capacity: 512 KiB.
56pub const DEFAULT_STRING_INTERNER_SIZE_BYTES: NonZeroUsize = NonZeroUsize::new(512 * 1024).unwrap();
57
58/// Maximum OTLP trace string interner capacity: 1 GiB. Arbitrary to stop @blt from blowing us up.
59pub const MAX_STRING_INTERNER_SIZE_BYTES: NonZeroUsize = NonZeroUsize::new(1024 * 1024 * 1024).unwrap();