Skip to main content

datadog_agent_config_overlay_model/
saluki_keys.rs

1//! Descriptions and displayed defaults for documented Saluki-only configuration keys.
2
3pub struct SalukiKey {
4    pub yaml_path: &'static str,
5    pub description: &'static str,
6    pub default: &'static str,
7    /// Multi-line documentation rendered as a prose section below the ADP-Only table.
8    /// If the text starts with `#`, the heading is taken from the text itself.
9    pub documentation: Option<&'static str>,
10}
11
12pub static SALUKI_KEYS: &[SalukiKey] = &[
13    SalukiKey {
14        yaml_path: "data_plane.experimental.apm.enabled",
15        description: "Run the experimental APM proxy in front of the trace-agent",
16        default: "false",
17        documentation: Some(
18            "### `data_plane.experimental.apm.*`
19
20\
21             With `data_plane.experimental.apm.enabled` set, ADP takes over the trace-agent's receiver. It \
22             listens where the trace-agent normally does (`apm_config.receiver_port`, \
23             `apm_config.receiver_socket`, `apm_config.apm_non_local_traffic`, and `bind_host`) and forwards \
24             requests for endpoints it does not handle itself to the trace-agent at \
25             `data_plane.experimental.apm.proxy_destination`. The Datadog \
26             Agent moves the trace-agent's receiver to that address.
27
28\
29             `data_plane.experimental.apm.proxy_destination` accepts either an HTTP endpoint \
30             (`http://host:port`, such as the default `http://127.0.0.1:8127`) or a Unix domain socket \
31             (`unix:///path/to/socket`, such as `unix:///var/run/datadog/trace-agent.socket`).
32
33\
34             Prefer an `http://` destination. Over a `unix://` destination, the trace-agent attributes requests \
35             that carry no container headers, and whose container ADP couldn't resolve, to ADP's own container.
36
37\
38             > [!WARNING]
39\
40             > Settings under `experimental` are unstable and may change, move, or be removed. Do not rely on \
41             backward compatibility.",
42        ),
43    },
44    SalukiKey {
45        yaml_path: "data_plane.experimental.apm.proxy_destination",
46        description: "HTTP or Unix socket URL of the relocated trace-agent",
47        default: "http://127.0.0.1:8127",
48        documentation: None,
49    },
50    SalukiKey {
51        yaml_path: "data_plane.experimental.apm.native_trace_intake",
52        description: "Serve the trace intake endpoints in ADP",
53        default: "false",
54        documentation: None,
55    },
56    SalukiKey {
57        yaml_path: "dogstatsd_allow_context_heap_allocs",
58        description: "Allow heap allocations for contexts",
59        default: "true",
60        documentation: None,
61    },
62    SalukiKey {
63        yaml_path: "dogstatsd_autoscale_udp_listeners",
64        description: "Bind multiple UDP sockets via SO_REUSEPORT",
65        default: "false",
66        documentation: None,
67    },
68    SalukiKey {
69        yaml_path: "dogstatsd_buffer_count",
70        description: "Baseline receive buffers",
71        default: "128",
72        documentation: None,
73    },
74    SalukiKey {
75        yaml_path: "dogstatsd_buffer_count_max",
76        description: "Maximum receive buffer count",
77        default: "32768",
78        documentation: None,
79    },
80    SalukiKey {
81        yaml_path: "dogstatsd_cached_contexts_limit",
82        description: "Max cached metric contexts",
83        default: "500000",
84        documentation: None,
85    },
86    SalukiKey {
87        yaml_path: "dogstatsd_cached_tagsets_limit",
88        description: "Max cached tagsets",
89        default: "500000",
90        documentation: None,
91    },
92    SalukiKey {
93        yaml_path: "dogstatsd_minimum_sample_rate",
94        description: "Floor for metric sample rates",
95        default: "0.000000003845",
96        documentation: Some(
97            "ADP enforces a minimum sample rate on incoming metrics to prevent memory exhaustion \
98             from extremely low sample rates on histograms and sketches. Sending metrics with a \
99             very high inverse sample rate (for example `@0.0000001`) can cause unbounded memory \
100             growth in a sketch; this setting prevents that. The default is conservative enough \
101             that normal clients are unaffected.",
102        ),
103    },
104    SalukiKey {
105        yaml_path: "metric_tag_value_allowlist",
106        description: "Per-metric tag value allow-list",
107        default: "[]",
108        documentation: Some(concat!(
109            "### `metric_tag_value_allowlist`\n\n",
110            "Use `metric_tag_value_allowlist` to bound metric cardinality by retaining selected values for a tag. ",
111            "Configure each list item with a `metric_prefix`, a `tag_name`, and the `values` to retain. The rule ",
112            "applies to every metric whose name starts with the prefix. Values not in the list lose the tag by default. To aggregate them under a sentinel instead, set ",
113            "`on_miss: replace` and configure `replacement`; the replacement defaults to `other`.\n\n",
114            "```yaml\n",
115            "metric_tag_value_allowlist:\n",
116            "  - metric_prefix: requests.\n",
117            "    tag_name: customer_id\n",
118            "    values: [customer-1, customer-2]\n",
119            "    on_miss: replace\n",
120            "    replacement: other\n",
121            "```\n\n",
122            "This ADP-only key is independent from `metric_tag_filterlist`. Remote Config updates to ",
123            "`metric_tag_filterlist` therefore do not replace locally configured value allow-lists. Value allow-list ",
124            "changes require an ADP restart in this initial implementation. Rules apply to counters and sketch-backed ",
125            "metrics before aggregation, including instrumented and origin tags. Like `metric_tag_filterlist`, value ",
126            "rules apply only to metrics that ADP aggregates. Metrics that carry an explicit client timestamp go ",
127            "through the no-aggregation pipeline (`dogstatsd_no_aggregation_pipeline`) and keep their tags unchanged. ",
128            "ADP matches `metric_prefix` after DogStatsD mapper rewrites and `statsd_metric_namespace` prefixing, so ",
129            "configure the final metric name produced by those steps.\n\n",
130            "Whole-tag filtering runs first. If `metric_tag_filterlist` uses `action: include`, add the value-filtered ",
131            "tag key to its `tags` list or the whole-tag rule removes it before value filtering. Value rules do not ",
132            "operate on bare tags such as `customer_id`, because they have no value. An empty string in a key/value ",
133            "tag such as `customer_id:` is a value and is subject to the allow-list; include `\"\"` in `values` to ",
134            "retain it. An empty `values` list treats every key/value tag as a mismatch.\n\n",
135            "Like `metric_tag_filterlist`, ADP compares `tag_name` with tag keys as Datadog stores them, normalizing ",
136            "both, so `tag_name: Customer ID` applies to `customer_id:top-1` and `CUSTOMER_ID:top-1`. ",
137            "Values are still matched exactly, so `customer_id:Top-1` does not match a configured `top-1`. A ",
138            "replacement tag uses the normalized tag name, such as `customer_id:other`. See ",
139            "`SPEC.md` in the `datadog-agent-tag-normalization` crate (`lib/datadog-agent/tag-normalization/`) for ",
140            "the rules.\n\n",
141            "Multiple rules may use the same prefix when they target different tags. Metric prefixes are compared ",
142            "exactly, without normalization. ADP rejects the configuration at startup when:\n\n",
143            "- distinct metric prefixes overlap, even when the rules target different tags, so that each metric ",
144            "matches at most one prefix\n",
145            "- a metric prefix or tag name is empty\n",
146            "- a tag name contains `:`\n\n",
147            "ADP ignores, with a warning:\n\n",
148            "- a rule whose tag name is 200 bytes or more once normalized, since Datadog never stores such a tag ",
149            "with a value\n",
150            "- a rule whose tag name normalizes to the same key as an earlier rule for the same prefix, such as ",
151            "`Customer ID` after `customer_id`\n\n",
152            "ADP does not trim configured strings: prefixes, ",
153            "values, and replacements preserve whitespace and match exactly. Whitespace in a tag name is normalized ",
154            "like any other character, so a trailing space becomes `_`. Configure a replacement that cannot collide ",
155            "with a real tag value.",
156        )),
157    },
158    SalukiKey {
159        yaml_path: "dogstatsd_permissive_decoding",
160        description: "Relaxes decoder strictness",
161        default: "true",
162        documentation: Some(
163            "By default, ADP parses DogStatsD packets with the same leniency as the core agent, \
164             accepting packets that technically violate the spec. Setting this to `false` enables \
165             strict mode, which rejects non-conformant packets. Strict mode is not available in \
166             the core agent.",
167        ),
168    },
169    SalukiKey {
170        yaml_path: "dogstatsd_string_interner_size_bytes",
171        description: "Explicit byte budget for context interner",
172        default: "",
173        documentation: Some(
174            "Accepts a bare integer number of bytes or a human-readable byte-size string such as `12MiB`. \
175             When unset, ADP derives the byte budget from `dogstatsd_string_interner_size`.",
176        ),
177    },
178    SalukiKey {
179        yaml_path: "dogstatsd_tcp_port",
180        description: "DogStatsD TCP listen port; 0 disables TCP",
181        default: "0",
182        documentation: None,
183    },
184    SalukiKey {
185        yaml_path: "otlp_config.traces.enable_otlp_compute_top_level_by_span_kind",
186        description: "Enable OTLP top-level-by-span-kind",
187        default: "",
188        documentation: None,
189    },
190    SalukiKey {
191        yaml_path: "otlp_config.traces.ignore_missing_datadog_fields",
192        description: "Ignore missing Datadog fields in OTLP",
193        default: "",
194        documentation: None,
195    },
196    SalukiKey {
197        yaml_path: "otlp_config.traces.string_interner_size",
198        description: "OTLP trace string interner capacity",
199        default: "",
200        documentation: None,
201    },
202    SalukiKey {
203        yaml_path: "otlp_config.receiver.protocols.http.transport",
204        description: "OTLP HTTP receiver transport",
205        default: "",
206        documentation: None,
207    },
208    SalukiKey {
209        yaml_path: "otlp_allow_context_heap_allocs",
210        description: "Allow heap allocations for OTLP contexts",
211        default: "",
212        documentation: None,
213    },
214    SalukiKey {
215        yaml_path: "otlp_cached_contexts_limit",
216        description: "Max cached OTLP metric contexts",
217        default: "",
218        documentation: None,
219    },
220    SalukiKey {
221        yaml_path: "otlp_cached_tagsets_limit",
222        description: "Max cached OTLP tagsets",
223        default: "",
224        documentation: None,
225    },
226    SalukiKey {
227        yaml_path: "otlp_string_interner_size",
228        description: "OTLP context interner capacity",
229        default: "",
230        documentation: None,
231    },
232    SalukiKey {
233        yaml_path: "aggregate_window_duration_seconds",
234        description: "Aggregation window size",
235        default: "",
236        documentation: None,
237    },
238    SalukiKey {
239        yaml_path: "aggregate_flush_interval",
240        description: "Aggregator flush period",
241        default: "",
242        documentation: None,
243    },
244    SalukiKey {
245        yaml_path: "aggregate_context_limit",
246        description: "Max contexts per aggregation window",
247        default: "",
248        documentation: None,
249    },
250    SalukiKey {
251        yaml_path: "aggregate_passthrough_idle_flush_timeout",
252        description: "Passthrough buffer flush delay",
253        default: "",
254        documentation: None,
255    },
256    SalukiKey {
257        yaml_path: "apm_config.obfuscation.sql.dbms",
258        description: "SQL obfuscation DBMS dialect",
259        default: "",
260        documentation: Some(
261            "SQL dialect to use when a span has neither `db.type` nor `db.system`. Per-span hints take precedence.",
262        ),
263    },
264    SalukiKey {
265        yaml_path: "apm_config.obfuscation.sql.dollar_quoted_func",
266        description: "Preserve dollar-quoted SQL functions",
267        default: "",
268        documentation: None,
269    },
270    SalukiKey {
271        yaml_path: "apm_config.obfuscation.sql.keep_sql_alias",
272        description: "Preserve SQL aliases in obfuscation",
273        default: "",
274        documentation: None,
275    },
276    SalukiKey {
277        yaml_path: "apm_config.obfuscation.sql.replace_digits",
278        description: "Replace digits in SQL obfuscation",
279        default: "",
280        documentation: None,
281    },
282    SalukiKey {
283        yaml_path: "apm_config.obfuscation.sql.table_names",
284        description: "Collect table names during obfuscation",
285        default: "",
286        documentation: Some(
287            "ADP ignores this key, and the `table_names` entry of `apm_config.features`, and logs a warning when \
288             either is set. The SQL obfuscator can't collect table names yet, so ADP doesn't set the `sql.tables` \
289             tag.",
290        ),
291    },
292    SalukiKey {
293        yaml_path: "flush_timeout_secs",
294        description: "Encoder flush timeout (secs)",
295        default: "",
296        documentation: None,
297    },
298    SalukiKey {
299        yaml_path: "serializer_max_metrics_per_payload",
300        description: "Max metrics per payload",
301        default: "",
302        documentation: None,
303    },
304    SalukiKey {
305        yaml_path: "dogstatsd_mapper_string_interner_size",
306        description: "Mapper string interner byte capacity",
307        default: "64KiB",
308        documentation: Some(
309            "Controls the pre-allocated byte capacity for interning mapped metric names and tags. The default is \
310             `64KiB`. Set this to a nonzero byte count; you can use a bare number of bytes or a human-readable \
311             byte-size string such as `64KiB`. Larger values increase memory usage.",
312        ),
313    },
314    SalukiKey {
315        yaml_path: "memory_limit",
316        description: "Process memory limit",
317        default: "",
318        documentation: Some(
319            "### `memory_limit` / `memory_slop_factor`
320
321\
322             ADP uses an explicit process memory limit (`memory_limit`) rather than relying on \
323             Go's garbage collector. The `memory_slop_factor` reserves a fraction of the limit \
324             to account for allocations not tracked by ADP's internal accounting. When memory \
325             usage approaches `memory_limit`, ADP's global limiter begins exerting backpressure \
326             (see `enable_global_limiter`).",
327        ),
328    },
329    SalukiKey {
330        yaml_path: "memory_slop_factor",
331        description: "Memory accounting slop fraction",
332        default: "0.25",
333        documentation: Some("See `memory_limit` above."),
334    },
335    SalukiKey {
336        yaml_path: "enable_global_limiter",
337        description: "Global memory limiter toggle",
338        default: "true",
339        documentation: Some(
340            "Controls whether the global memory limiter exerts backpressure as memory usage \
341             approaches `memory_limit`. The default is `true`. When set to `false`, the limiter \
342             becomes a no-op and only the memory bounds of the running components influence \
343             memory usage.",
344        ),
345    },
346    SalukiKey {
347        yaml_path: "memory_mode",
348        description: "Memory bounds validation mode",
349        default: "disabled",
350        documentation: Some(
351            "Controls how the calculated memory bounds are reconciled against `memory_limit`. The \
352             default is `disabled`. Accepted values: `disabled` skips bounds validation and applies \
353             no memory limiting; `permissive` logs a warning when the bounds do not fit within the \
354             limit and starts anyway; `strict` refuses to start. Under `permissive` and `strict`, \
355             the global memory limiter is active only when a limit is in effect (configured or \
356             detected from cgroups) and `enable_global_limiter` is `true`.",
357        ),
358    },
359];