Skip to content

fix(config): accept streamed null as an empty configuration collection - #2762

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
jszwedko/null-config-collections
Oct 2, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
jszwedko/null-config-collections

Conversation

@jszwedko

@jszwedko jszwedko commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The Datadog streams null for an empty or cleared list or map. We need to handle this as an empty collection.

Fixes #2750.

Test plan

  • New reader unit tests in list_de.rs and cast_de.rs: null and empty inputs read as empty, null replace_tags elements read as empty maps (sequence and JSON-string forms)
  • New null_collection_tests in datadog-agent-config: every collection leaf in the generated model accepts null; null yields empty while an absent histogram_aggregates keeps its default
  • New system.rs tests: a startup snapshot with null collections translates, and a null update clears a previously non-empty additional_endpoints/histogram_aggregates (both fail without the fix)
  • New translator test: replace_tags rules missing name or pattern (including [null]) are rejected with the trace-agent's messages
  • Follow-up once chore(config): replay the agent config corpus through adp #2722 lands: remove the replay expectations this makes match

🤖 Generated with Claude Code

The Datadog Agent's configuration stream can carry `null` for an empty or
cleared list or map, and its accessors read that as empty. ADP's shared
collection deserializers rejected it, failing startup or discarding updates
(for example `histogram_aggregates: []`, an empty `proxy.no_proxy`, or an
update clearing `additional_endpoints`).

The list and map deserializers now read `null` as empty; an absent key still
takes its schema default. A null element in `apm_config.replace_tags` reads
as an empty map, and rules missing `name` or `pattern` are rejected, matching
the trace-agent.

Fixes #2750.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jszwedko
jszwedko requested a review from a team as a code owner October 2, 2026 17:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T17:04:50.562624Z 67c193b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67c193bb68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

Explicit null collections normalize only when present, preserving schema defaults for absent keys; malformed replace_tags rules are rejected consistently with trace-agent behavior.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 67c193b · @DataDog review to ask questions

Comment thread lib/datadog-agent/config/src/list_de.rs Outdated
Comment thread lib/datadog-agent/config/src/cast_de.rs Outdated
jszwedko and others added 2 commits October 2, 2026 13:08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jesse Szwedko <jesse@szwedko.me>
@pr-commenter

pr-commenter Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: a41cd43 · Comparison: 5d1070d · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 38.27 MiB (baseline) vs 38.30 MiB (comparison)
Size Change: +32.18 KiB (+0.08%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
agent_data_plane_config_system::translators::datadog_translator +24.94 KiB 70
anon.a6926c6c21417749435f71dba1b992d8.976.llvm.13372907567088152362 +20.54 KiB 1
anon.a6926c6c21417749435f71dba1b992d8.976.llvm.1534094455157536209 -20.54 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.2.llvm.13921711517418886414 +16.09 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.2.llvm.240572210426274404 -16.09 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.768.llvm.13921711517418886414 +14.63 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.768.llvm.240572210426274404 -14.62 KiB 1
anon.53bb41fcd4d7cb0fd4749e93eb822af9.155.llvm.5834098439156321449 +14.40 KiB 1
anon.53bb41fcd4d7cb0fd4749e93eb822af9.155.llvm.2364525274383654594 -14.40 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.766.llvm.13921711517418886414 +12.84 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.766.llvm.240572210426274404 -12.84 KiB 1
datadog_agent_config::generated::witness -9.49 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.704.llvm.13921711517418886414 +8.23 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.704.llvm.240572210426274404 -8.23 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.668.llvm.13921711517418886414 +7.67 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.668.llvm.240572210426274404 -7.67 KiB 1
std +4.41 KiB 17
anon.87e7c38bfd928d17fa28187081c51bf0.663.llvm.13921711517418886414 +4.30 KiB 1
anon.87e7c38bfd928d17fa28187081c51bf0.663.llvm.240572210426274404 -4.30 KiB 1
agent_data_plane_config_system::saluki_env_overlay::discover_leaf_specs -4.14 KiB 1
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.2% +44.7Ki  +0.8% +21.2Ki    [6318 Others]
  [NEW] +20.5Ki  [NEW] +20.5Ki    anon.a6926c6c21417749435f71dba1b992d8.976.llvm.13372907567088152362
  [NEW] +16.1Ki  [NEW]     +76    anon.87e7c38bfd928d17fa28187081c51bf0.2.llvm.13921711517418886414
  [NEW] +14.6Ki  [NEW]     +81    anon.87e7c38bfd928d17fa28187081c51bf0.768.llvm.13921711517418886414
  [NEW] +14.4Ki  [NEW] +14.3Ki    anon.53bb41fcd4d7cb0fd4749e93eb822af9.155.llvm.5834098439156321449
  [NEW] +12.8Ki  [NEW]     +82    anon.87e7c38bfd928d17fa28187081c51bf0.766.llvm.13921711517418886414
  [NEW] +8.23Ki  [NEW]     +79    anon.87e7c38bfd928d17fa28187081c51bf0.704.llvm.13921711517418886414
  [NEW] +7.67Ki  [NEW]     +91    anon.87e7c38bfd928d17fa28187081c51bf0.668.llvm.13921711517418886414
 +18e2% +4.32Ki +39e2% +4.34Ki    std::sync::once::Once::call_once_force::_{{closure}}::h183a85dc4526003c
  [NEW] +4.30Ki  [NEW]     +74    anon.87e7c38bfd928d17fa28187081c51bf0.663.llvm.13921711517418886414
  [DEL] -3.25Ki  [DEL]     -80    anon.8497dcbfe18a88a5c521d68122c58c57.158.llvm.4254686513008680023
  [DEL] -4.14Ki  [DEL] -4.02Ki    agent_data_plane_config_system::saluki_env_overlay::discover_leaf_specs::h496f05c3742461ae
  [DEL] -4.30Ki  [DEL]     -74    anon.87e7c38bfd928d17fa28187081c51bf0.663.llvm.240572210426274404
  [DEL] -7.67Ki  [DEL]     -91    anon.87e7c38bfd928d17fa28187081c51bf0.668.llvm.240572210426274404
  [DEL] -8.23Ki  [DEL]     -79    anon.87e7c38bfd928d17fa28187081c51bf0.704.llvm.240572210426274404
 -30.6% -9.49Ki -30.7% -9.46Ki    datadog_agent_config::generated::witness::drive::h5f0a3f05b22b2ac2
  [DEL] -12.8Ki  [DEL]     -82    anon.87e7c38bfd928d17fa28187081c51bf0.766.llvm.240572210426274404
  [DEL] -14.4Ki  [DEL] -14.3Ki    anon.53bb41fcd4d7cb0fd4749e93eb822af9.155.llvm.2364525274383654594
  [DEL] -14.6Ki  [DEL]     -81    anon.87e7c38bfd928d17fa28187081c51bf0.768.llvm.240572210426274404
  [DEL] -16.1Ki  [DEL]     -76    anon.87e7c38bfd928d17fa28187081c51bf0.2.llvm.240572210426274404
  [DEL] -20.5Ki  [DEL] -20.5Ki    anon.a6926c6c21417749435f71dba1b992d8.976.llvm.1534094455157536209
  +0.1% +32.2Ki  +0.0% +11.9Ki    TOTAL

@pr-commenter

pr-commenter Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: adccb664-4a9c-4fe3-937b-6f5e7b978b16
Baseline: a41cd434 · Comparison: 5d1070d4 · diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment (5)

Experiments configured erratic: true are tagged (ignored) and skipped when determining which experiments regressed or improved. Experiments which are detected as erratic at runtime are tagged (erratic) to flag that the run's sample dispersion was high, but their regression / improvement signal still counts.

experiment goal Δ mean % links
quality_gates_rss_dsd_low memory ⚪ +0.43 metrics profiles logs
quality_gates_rss_dsd_heavy memory ⚪ +0.17 metrics profiles logs
quality_gates_rss_dsd_medium memory ⚪ +0.04 metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory ⚪ -0.25 metrics profiles logs
quality_gates_rss_idle memory ⚪ -0.27 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 230 MiB ≤ 250 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 51.2 MiB ≤ 60 MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 91.6 MiB ≤ 100 MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 389 MiB ≤ 420 MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 33.4 MiB ≤ 40 MiB metrics profiles logs
Explanation

A change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression (is_regression: true). Improvements use the matching criteria for the improving direction. Experiments configured erratic: true (tagged (ignored)) are skipped outright; experiments detected as erratic at runtime (tagged (erratic)) still count, since that flag describes sample dispersion rather than directional certainty. The Δ mean % cell is colored accordingly: 🟢 = improvement, 🔴 = regression, ⚪ = neutral. Reduction in CPU or memory is an improvement; reduction in ingress throughput is a regression. Experiments tagged (no analysis) show ⚠️ n/a: SMP ran them but produced no analysis, usually because a replicate failed and exhausted its retries. Check the SMP report for that experiment's replicate failures.

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 6e3f308 into main Oct 2, 2026
112 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the jszwedko/null-config-collections branch October 2, 2026 18:06
dd-octo-sts Bot pushed a commit that referenced this pull request Oct 2, 2026
#2762)

## Summary

The Datadog streams `null` for an empty or cleared list or map. We need to handle this as an empty collection.

Fixes #2750.

## Test plan

- [x] New reader unit tests in `list_de.rs` and `cast_de.rs`: `null` and empty inputs read as empty, null `replace_tags` elements read as empty maps (sequence and JSON-string forms)
- [x] New `null_collection_tests` in `datadog-agent-config`: every collection leaf in the generated model accepts `null`; `null` yields empty while an absent `histogram_aggregates` keeps its default
- [x] New `system.rs` tests: a startup snapshot with null collections translates, and a `null` update clears a previously non-empty `additional_endpoints`/`histogram_aggregates` (both fail without the fix)
- [x] New translator test: `replace_tags` rules missing `name` or `pattern` (including `[null]`) are rejected with the trace-agent's messages
- [ ] Follow-up once #2722 lands: remove the replay expectations this makes match

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: jesse.szwedko <jesse.szwedko@datadoghq.com> 6e3f308
tobz pushed a commit that referenced this pull request Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accept streamed null as an empty configuration collection

2 participants