Skip to content

chore(config): fix the struct shape for saluki-only fields#1986

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
m/pr3b-env-keys
Jul 13, 2026
Merged

chore(config): fix the struct shape for saluki-only fields#1986
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
m/pr3b-env-keys

Conversation

@webern

@webern webern commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Human Summary

It is challenging to get the new typed config into exactly the right shape for component integration ahead of time since the context is so large. But one big mistake had to be fixed. SalukiOnly is a deserialization struct and needs to match the shape of the keys it will be deserializing. Fixed in this PR.

AI Summary

Reshape the typed configuration model and Saluki-only source so their structures match the configuration-key hierarchy directly.

  • Rework SalukiOnly to deserialize the Saluki-only configuration paths without an additional structural translation layer.
  • Represent the memory limit as bytes in the typed model, allowing bare integer values to load correctly.
  • Give Aggregation defaults that are valid for downstream aggregate transforms.
  • Remove the duplicate Saluki-only counter_expiry_seconds field so the Datadog-schema value remains authoritative.

Change Type

  • Non-functional (chore, refactoring, docs)

How did you test this PR?

  • make build-schema-overlay
  • make fmt
  • make check-docs
  • make check-all
  • make test

All checks passed; 1,801 tests passed and 31 were skipped.

References

This is the first PR in the stacked configuration-system changes. The environment-variable and runtime-integration changes build on this branch.

@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jul 4, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 3 Pipeline jobs failed

DataDog/saluki | build-adp-image   View in Datadog   GitLab

DataDog/saluki | build-adp-image-fips   View in Datadog   GitLab

DataDog/saluki | run-benchmarks-adp   View in Datadog   GitLab

ℹ️ Info

🔄 Datadog auto-retried 4 jobs - 0 passed on retry View in Datadog

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 75c5e64 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jul 4, 2026

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: 33d6ac6 · Comparison: 75c5e64 · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 41.58 MiB (baseline) vs 41.58 MiB (comparison)
Size Change: +0 B (+0.00%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
anon.104b1f618a14d6d60f2ebe1b651d81f5.1.llvm.9103550426358336748 +129 B 1
anon.104b1f618a14d6d60f2ebe1b651d81f5.1.llvm.9054900619091518955 -129 B 1
anon.104b1f618a14d6d60f2ebe1b651d81f5.4.llvm.9103550426358336748 +114 B 1
anon.104b1f618a14d6d60f2ebe1b651d81f5.4.llvm.9054900619091518955 -114 B 1
anon.104b1f618a14d6d60f2ebe1b651d81f5.3.llvm.9103550426358336748 +108 B 1
anon.104b1f618a14d6d60f2ebe1b651d81f5.3.llvm.9054900619091518955 -108 B 1
anon.104b1f618a14d6d60f2ebe1b651d81f5.0.llvm.9103550426358336748 +96 B 1
anon.104b1f618a14d6d60f2ebe1b651d81f5.0.llvm.9054900619091518955 -96 B 1
anon.104b1f618a14d6d60f2ebe1b651d81f5.2.llvm.9103550426358336748 +94 B 1
anon.104b1f618a14d6d60f2ebe1b651d81f5.2.llvm.9054900619091518955 -94 B 1
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW]    +129  [NEW]     +40    anon.104b1f618a14d6d60f2ebe1b651d81f5.1.llvm.9103550426358336748
  [NEW]    +114  [NEW]     +25    anon.104b1f618a14d6d60f2ebe1b651d81f5.4.llvm.9103550426358336748
  [NEW]    +108  [NEW]     +19    anon.104b1f618a14d6d60f2ebe1b651d81f5.3.llvm.9103550426358336748
  [NEW]     +96  [NEW]      +7    anon.104b1f618a14d6d60f2ebe1b651d81f5.0.llvm.9103550426358336748
  [NEW]     +94  [NEW]      +5    anon.104b1f618a14d6d60f2ebe1b651d81f5.2.llvm.9103550426358336748
  [DEL]     -94  [DEL]      -5    anon.104b1f618a14d6d60f2ebe1b651d81f5.2.llvm.9054900619091518955
  [DEL]     -96  [DEL]      -7    anon.104b1f618a14d6d60f2ebe1b651d81f5.0.llvm.9054900619091518955
  [DEL]    -108  [DEL]     -19    anon.104b1f618a14d6d60f2ebe1b651d81f5.3.llvm.9054900619091518955
  [DEL]    -114  [DEL]     -25    anon.104b1f618a14d6d60f2ebe1b651d81f5.4.llvm.9054900619091518955
  [DEL]    -129  [DEL]     -40    anon.104b1f618a14d6d60f2ebe1b651d81f5.1.llvm.9054900619091518955
  [ = ]       0  [ = ]       0    TOTAL

@pr-commenter

pr-commenter Bot commented Jul 4, 2026

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: ab23e742-1558-4aee-a5a5-96c49260d1dd
Baseline: 33d6ac63 · Comparison: 75c5e647 · 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_medium memory ⚪ +0.19 metrics profiles logs
quality_gates_rss_idle memory ⚪ +0.13 metrics profiles logs
quality_gates_rss_dsd_low memory ⚪ +0.12 metrics profiles logs
quality_gates_rss_dsd_heavy memory ⚪ +0.03 metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory ⚪ +0.01 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 137 MiB ≤ 140 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 43.1 MiB ≤ 50 MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 64.8 MiB ≤ 75 MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 192 MiB ≤ 200 MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 29 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.

@webern webern force-pushed the m/pr3b-env-keys branch from e6bfdc9 to 74ecadf Compare July 5, 2026 11:55
@dd-octo-sts dd-octo-sts Bot added the area/components Sources, transforms, and destinations. label Jul 5, 2026
@webern webern changed the title chore(config): overlay flat env-var keys onto the nested Datadog config chore(config): fix env-overlay behavior and saluki only shape Jul 5, 2026
@webern webern force-pushed the m/pr3b-env-keys branch from 67baf4b to 3a5cfe3 Compare July 8, 2026 15:21
@webern webern marked this pull request as ready for review July 8, 2026 16:21
@webern webern requested a review from a team as a code owner July 8, 2026 16:21
Copilot AI review requested due to automatic review settings July 8, 2026 16:21

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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: 3a5cfe3652

ℹ️ 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".

Comment thread lib/datadog-agent/config/build/env_overlay_gen.rs Outdated
Comment thread lib/agent-data-plane-config-system/src/saluki_only.rs Outdated
Copilot AI review requested due to automatic review settings July 8, 2026 18:01
@webern webern force-pushed the m/pr3b-env-keys branch from 3a5cfe3 to c5032e8 Compare July 8, 2026 18:01

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 9, 2026 09:44
@webern webern force-pushed the m/pr3b-env-keys branch from c5032e8 to 24621f3 Compare July 9, 2026 09:44

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 9, 2026 12:02
@webern webern force-pushed the m/pr3b-env-keys branch from 24621f3 to cd6d290 Compare July 9, 2026 12:02
@webern webern force-pushed the m/pr3b-env-keys branch from f4bc7fe to 1173bd6 Compare July 13, 2026 10:06
@dd-octo-sts dd-octo-sts Bot added the area/test All things testing: unit/integration, correctness, SMP regression, etc. label Jul 13, 2026
Rework the shape of SalukiConfiguration and the SalukiOnly source so each
maps cleanly to its real config-key path, before the environment-variable
and runtime work builds on top. No component or runtime behavior changes
here.

- Reshape the Saluki-only source struct to mirror the config-key hierarchy
  exactly, so each field maps by plain serde to its real config-key path.
- Model the memory limit as a byte size (u64 in the model, ByteSize in the
  source) so a bare-integer value no longer fails the whole config load.
- Give Aggregation an explicit Default whose values match what the aggregate
  transform expects; a zero window, in particular, is invalid downstream.
- Drop the duplicate counter_expiry_seconds Saluki-only field: the key lives
  in the Datadog schema, so the witnessed path is authoritative and the
  source copy is a second source of truth.
@webern webern force-pushed the m/pr3b-env-keys branch 2 times, most recently from 095bd65 to 75c5e64 Compare July 13, 2026 12:18
@dd-octo-sts dd-octo-sts Bot removed area/components Sources, transforms, and destinations. area/test All things testing: unit/integration, correctness, SMP regression, etc. labels Jul 13, 2026
@webern webern changed the title chore(config): fix env-overlay behavior and saluki only shape chore(config): reshape the typed config model and Saluki-only source Jul 13, 2026
@webern webern changed the title chore(config): reshape the typed config model and Saluki-only source chore(config): reshape the typed config model Jul 13, 2026
@webern webern changed the title chore(config): reshape the typed config model chore(config): reshape the typed config model and Saluki-only source Jul 13, 2026
@webern webern marked this pull request as ready for review July 13, 2026 12:26

@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: 75c5e64744

ℹ️ 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".

Comment thread lib/agent-data-plane-config/src/domains/dogstatsd.rs
@webern webern closed this Jul 13, 2026
@webern webern deleted the m/pr3b-env-keys branch July 13, 2026 12:33
@webern webern restored the m/pr3b-env-keys branch July 13, 2026 12:37
@webern webern reopened this Jul 13, 2026
@webern webern marked this pull request as draft July 13, 2026 12:38
@webern webern marked this pull request as ready for review July 13, 2026 13:09
@webern webern changed the title chore(config): reshape the typed config model and Saluki-only source chore(config): fix the struct shape for saluki-only fields Jul 13, 2026

@tobz tobz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 9428485 into main Jul 13, 2026
102 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the m/pr3b-env-keys branch July 13, 2026 13:56
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Jul 15, 2026
)

## Human Summary

This PR should unblock the typed config project. Issues arose from trying to deserialize typed config from `GenericConfiguration` because Figment was doing a sort of heuristic coercion of environment variables without knowledge of their destination types. I believe this is actually lossy, but either way, it was easier to remove Figment from the deserialization and translation pathway (since we have the Datadog schema) than it was to try to deserialize from Figment's model of the config map.

In this PR we hand the initial file read over to the typed config system which deserializes it and applies environment variable precedence to it (configurable) based on the information we have in the schema and a port of the environment variable handling algorithms as found in the Agent.

Ownership of the config stream is given to the new typed config system, and `GenericConfiguration` and the typed system operate independently with it. First the typed system merges what it receives into a copy its own `serde_json::Value` map, then it updates typed configuration and sends the `ConfigUpdate` on to the `GenericConfiguration` map which behaves as it always has, using Figment, etc.

If an error occurs during typed config deserialization and translation, that error will be logged, but the `ConfigUpdate` will be sent on to `GenericConfiguration` anyway in order to preserve current system behavior. The thinking behind this is that during a transition to typed configuration, we want to leave things running the same way the have been, and we will add configuration tests to make sure we have no error logs.

We want to gain confidence that we aren't seeing errors during deserialization or translation and quickly switch over to blocking the `ConfigUpdate` from reaching `GenericConfiguration` in the presence of an error so that the two views of config cannot drift from one another. The ultimate goal, really, is going to be to migrate everything over to typed config as quickly as possible so that two views of the config do not even exist in the system.

This PR is separate from #2094 so that this PR can land without touching `agent-data-plane`. The integration with `agent-data-plane` takes place in the next PR, but looking at that PR will be helpful in terms of understanding how this integrates with `run.rs` and system startup.

## AI Summary

Support environment variables whose flat, underscore-joined names correspond to nested typed configuration paths.

- Add a generated overlay for Datadog configuration keys before typed deserialization.
- Discover and overlay Saluki-only nested paths from the typed source model.
- Support disabled, fallback, and override overlay modes while preserving the Agent configuration stream's precedence in fallback mode.
- Preserve the Agent's whitespace-separated handling for string-list environment values.

The overlays are applied per source before deserialization, so relocating keys for one source does not affect the other.

## Change Type
- [x] Non-functional (chore, refactoring, docs)

## How did you test this PR?

- [x] Conducted an extensive clean-room audit of with independent, no-context model reviews; found and fixed numeric byte-size compatibility and full-path duration-codegen collisions.
- [x] All the usual local gates with AI-added unit tests for new functionality
- [x] CI

## References

Stacked on [#1986](#1986).


Co-authored-by: matt.briggs <matt.briggs@datadoghq.com>
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 15, 2026
)

## Human Summary

This PR should unblock the typed config project. Issues arose from trying to deserialize typed config from `GenericConfiguration` because Figment was doing a sort of heuristic coercion of environment variables without knowledge of their destination types. I believe this is actually lossy, but either way, it was easier to remove Figment from the deserialization and translation pathway (since we have the Datadog schema) than it was to try to deserialize from Figment's model of the config map.

In this PR we hand the initial file read over to the typed config system which deserializes it and applies environment variable precedence to it (configurable) based on the information we have in the schema and a port of the environment variable handling algorithms as found in the Agent.

Ownership of the config stream is given to the new typed config system, and `GenericConfiguration` and the typed system operate independently with it. First the typed system merges what it receives into a copy its own `serde_json::Value` map, then it updates typed configuration and sends the `ConfigUpdate` on to the `GenericConfiguration` map which behaves as it always has, using Figment, etc.

If an error occurs during typed config deserialization and translation, that error will be logged, but the `ConfigUpdate` will be sent on to `GenericConfiguration` anyway in order to preserve current system behavior. The thinking behind this is that during a transition to typed configuration, we want to leave things running the same way the have been, and we will add configuration tests to make sure we have no error logs.

We want to gain confidence that we aren't seeing errors during deserialization or translation and quickly switch over to blocking the `ConfigUpdate` from reaching `GenericConfiguration` in the presence of an error so that the two views of config cannot drift from one another. The ultimate goal, really, is going to be to migrate everything over to typed config as quickly as possible so that two views of the config do not even exist in the system.

This PR is separate from #2094 so that this PR can land without touching `agent-data-plane`. The integration with `agent-data-plane` takes place in the next PR, but looking at that PR will be helpful in terms of understanding how this integrates with `run.rs` and system startup.

## AI Summary

Support environment variables whose flat, underscore-joined names correspond to nested typed configuration paths.

- Add a generated overlay for Datadog configuration keys before typed deserialization.
- Discover and overlay Saluki-only nested paths from the typed source model.
- Support disabled, fallback, and override overlay modes while preserving the Agent configuration stream's precedence in fallback mode.
- Preserve the Agent's whitespace-separated handling for string-list environment values.

The overlays are applied per source before deserialization, so relocating keys for one source does not affect the other.

## Change Type
- [x] Non-functional (chore, refactoring, docs)

## How did you test this PR?

- [x] Conducted an extensive clean-room audit of with independent, no-context model reviews; found and fixed numeric byte-size compatibility and full-path duration-codegen collisions.
- [x] All the usual local gates with AI-added unit tests for new functionality
- [x] CI

## References

Stacked on [#1986](#1986).

Co-authored-by: matt.briggs <matt.briggs@datadoghq.com> be0a7a1
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.

3 participants