@@ -46,7 +46,7 @@ pub struct Domain {
4646}
4747
4848/// Source listeners and packet-decoding options.
49- #[ derive( Clone , Debug , Default , PartialEq , Serialize ) ]
49+ #[ derive( Clone , Debug , PartialEq , Serialize ) ]
5050pub struct Listeners {
5151 /// UDP port DogStatsD listens on.
5252 pub port : u16 ,
@@ -114,6 +114,39 @@ pub struct Listeners {
114114 pub forward_port : u16 ,
115115}
116116
117+ impl Default for Listeners {
118+ fn default ( ) -> Self {
119+ Self {
120+ // Saluki-schema-only knobs whose defaults are not published by the Datadog Agent schema,
121+ // so they are seeded only when set; absent that, these values stand and must match what
122+ // the DogStatsD source expects.
123+ buffer_count : 128 ,
124+ buffer_count_max : 256 ,
125+ permissive_decoding : true ,
126+ // Datadog-schema and unset-by-default knobs: the witness driver overwrites the former,
127+ // and the latter are genuinely zero/empty/None when unset.
128+ port : 0 ,
129+ tcp_port : 0 ,
130+ socket : None ,
131+ stream_socket : None ,
132+ pipe_name : None ,
133+ windows_pipe_security_descriptor : String :: new ( ) ,
134+ non_local_traffic : false ,
135+ bind_host : None ,
136+ so_rcvbuf : 0 ,
137+ buffer_size : 0 ,
138+ autoscale_udp_listeners : false ,
139+ provider_kind : String :: new ( ) ,
140+ capture_path : PathBuf :: new ( ) ,
141+ capture_depth : 0 ,
142+ eol_required : Vec :: new ( ) ,
143+ stream_log_too_big : false ,
144+ forward_host : None ,
145+ forward_port : 0 ,
146+ }
147+ }
148+ }
149+
117150/// Origin detection and tag cardinality.
118151#[ derive( Clone , Debug , Default , PartialEq , Serialize ) ]
119152pub struct OriginDetection {
@@ -153,8 +186,15 @@ pub struct Telemetry {
153186 pub origin_breakdown : bool ,
154187}
155188
189+ /// The default floor for DogStatsD metric sample rates. (not in Datadog Agent config schema)
190+ ///
191+ /// Roughly 260M samples; sample rates below this are clamped to bound tracked-sample memory growth.
192+ const fn default_minimum_sample_rate ( ) -> f64 {
193+ 0.000000003845
194+ }
195+
156196/// Context cache sizing and sample-rate floor.
157- #[ derive( Clone , Debug , Default , PartialEq , Serialize ) ]
197+ #[ derive( Clone , Debug , PartialEq , Serialize ) ]
158198pub struct Contexts {
159199 /// Maximum number of metric contexts held in the cache. (not in Datadog Agent config schema)
160200 pub cached_contexts_limit : usize ,
@@ -178,6 +218,24 @@ pub struct Contexts {
178218 pub minimum_sample_rate : f64 ,
179219}
180220
221+ impl Default for Contexts {
222+ fn default ( ) -> Self {
223+ Self {
224+ // Saluki-schema-only knobs: not published by the Datadog Agent schema, so they are
225+ // seeded only when set; absent that, these values stand and must match what the
226+ // DogStatsD source expects.
227+ cached_contexts_limit : 500_000 ,
228+ cached_tagsets_limit : 500_000 ,
229+ allow_context_heap_allocs : true ,
230+ minimum_sample_rate : default_minimum_sample_rate ( ) ,
231+ // Datadog-schema knob: overwritten by the witness driver.
232+ string_interner_size : 0 ,
233+ // Unset by default; `None` selects the entry-count-derived interner size.
234+ string_interner_size_bytes : None ,
235+ }
236+ }
237+ }
238+
181239/// Metric aggregation window and flush behavior.
182240#[ derive( Clone , Debug , PartialEq , Serialize ) ]
183241pub struct Aggregation {
@@ -232,19 +290,39 @@ impl Default for Aggregation {
232290 }
233291}
234292
293+ /// The default byte budget for the mapper's string interner. (not in Datadog Agent config schema)
294+ ///
295+ /// 64 KiB, matching the DogStatsD mapper's prior default.
296+ const fn default_mapper_string_interner_size ( ) -> u64 {
297+ 65_536
298+ }
299+
235300/// DogStatsD metric mapper.
236- #[ derive( Clone , Debug , Default , PartialEq , Serialize ) ]
301+ #[ derive( Clone , Debug , PartialEq , Serialize ) ]
237302pub struct Mapper {
238303 /// Mapper profiles that rewrite matching metric names and tags.
239304 pub profiles : Vec < MapperProfile > ,
240305
241306 /// Number of mapper match results cached.
242307 pub cache_size : usize ,
243308
244- /// Number of entries the mapper's string interner holds . (not in Datadog Agent config schema)
309+ /// Byte budget for the mapper's string interner. (not in Datadog Agent config schema)
245310 pub string_interner_size : u64 ,
246311}
247312
313+ impl Default for Mapper {
314+ fn default ( ) -> Self {
315+ Self {
316+ // Datadog-schema knobs: overwritten by the witness driver.
317+ profiles : Vec :: new ( ) ,
318+ cache_size : 0 ,
319+ // Saluki-schema-only knob: seeded only when set; absent that, this value stands and
320+ // must be non-zero, as the mapper rejects a zero-sized interner.
321+ string_interner_size : default_mapper_string_interner_size ( ) ,
322+ }
323+ }
324+ }
325+
248326/// One mapper profile: a name, a metric prefix, and the mappings under it.
249327#[ derive( Clone , Debug , Default , PartialEq , Serialize ) ]
250328pub struct MapperProfile {
0 commit comments