Repository navigation
[APMSVLS-674] Support space-separated DD_APM_FEATURES and delimited strings in apm_config.features - #186
[APMSVLS-674] Support space-separated DD_APM_FEATURES and delimited strings in apm_config.features#186lucaspimentel wants to merge 4 commits into
DD_APM_FEATURES and delimited strings in apm_config.features#186Conversation
Split DD_APM_FEATURES on commas, or on spaces when no comma is present, matching the Go agent's comma_then_space_separated env parser. Entries are trimmed and empty entries dropped, so a documented value like 'error_rare_sample_tracer_drop enable_otlp_compute_top_level_by_span_kind' now enables both features instead of one unmatchable entry. DD_PROXY_NO_PROXY keeps comma-only splitting; the divergence from the Go agent's comma+space NO_PROXY parsing is documented at the field.
A string value in the YAML features setting was silently dropped to an empty list. It is now split with the same comma-then-space rules as the DD_APM_FEATURES env var (comma wins as delimiter when present, otherwise spaces split; entries are trimmed and empties dropped). Native YAML lists keep working as before, and non-string values still fall back to an empty list with a warning.
DD_APM_FEATURES and delimited strings in apm_config.features
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@DataDog review |
There was a problem hiding this comment.
More details
The parsing paths consistently apply comma-first delimiter selection to environment and YAML strings while preserving native YAML lists and configuration merge behavior. The completed static review identified no reportable defects.
🤖 Bits Code Review · Commit 15c69f8
litianningdatadog
left a comment
There was a problem hiding this comment.
Left some comment.
There was a problem hiding this comment.
🟡 Changes recommended
Rejected configuration values can expose credentials in the new warning logs.
1 open finding
What changed in this PR
Adds comma-then-space parsing for APM feature settings in the agent configuration crate.
Changes:
- Supports space-separated environment values and delimited YAML strings.
- Adds parsing and precedence tests while retaining YAML list support.
- Documents intentional differences from Go parsing.
| File | Description |
|---|---|
| crates/datadog-agent-config/src/sources/yaml.rs | Enables string-or-list parsing and adds YAML tests. |
| crates/datadog-agent-config/src/sources/env.rs | Updates feature parsing and tests; documents unchanged proxy parsing. |
| crates/datadog-agent-config/src/deserializers/helpers.rs | Adds shared splitting and YAML deserialization helpers. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…t a string, matching the Go agent
|
@DataDog review |
There was a problem hiding this comment.
More details
Delimiter selection matches the documented comma-precedence and literal-space rules. Static review found no actionable regression in YAML list handling or environment-over-YAML precedence.
🤖 Bits Code Review · Commit 2b74360

What does this PR do?
Parses
DD_APM_FEATURESand theapm_config.featuresYAML setting with comma-then-space delimiter selection, matching the Go agent'scomma_then_space_separatedenv parser: if the value contains a comma, commas are the delimiter; otherwise spaces are. Entries are trimmed and empty entries dropped, so a docs-style value like this now enables both features instead of one unmatchable entry:deserialize_comma_then_space_separated_stringhelper;DD_PROXY_NO_PROXYkeeps comma-only splitting, with the divergence from the Go agent's comma+spaceNO_PROXYparsing documented at the field.apm_config.featurespreviously rejected delimited strings entirely (silently falling back to an empty list). A new dual-shape deserializer accepts native lists as before, and splits delimited strings with the same comma-then-space rules. A native list with a non-string element is dropped entirely (with a warning), matching the Go agent'sGetStringSliceall-or-nothing behavior. Other shapes fall back to an empty list with a warning.Motivation
The public docs show space-separated
DD_APM_FEATURESvalues, but the env source split on commas only, so space-separated feature lists silently failed exact-match consumers. First consumer is the upcoming bottlecaperror_rare_sample_tracer_dropgate in DataDog/datadog-lambda-extension#1427Additional Notes
DD_PROXY_NO_PROXYpaths with Go's splitting (or non-splitting) rules could change which entries existing users' configs produce, silently enabling or disabling features. Any alignment therefore needs its own breaking-change consideration rather than a drop-in fix.pkg/config/helper/env.go(ParseEnvSplitCommaThenSpace) andpkg/config/schema/yaml/apm_config.yaml(env_parser: comma_then_space_separated) inDataDog/datadog-agent.Describe how to test/QA your changes
Suite passes. New figment
Jailtests cover: space-separated and comma-separated values, mixed separators (comma wins, space stays inside the entry), trimming and empty-entry dropping, blank values, tab staying inside an entry, the native YAML list shape, and env-over-YAML merge order. Existing list and wrong-type fallback tests forapm_config.featuresstill pass.APMSVLS-674.