Skip to content

chore(config): add runtime configuration updates - #1977

Merged
webern merged 1 commit into
mainfrom
m/pr3-dynamic
Jul 10, 2026
Merged

chore(config): add runtime configuration updates#1977
webern merged 1 commit into
mainfrom
m/pr3-dynamic

Conversation

@webern

@webern webern commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Human Summary

Adds a typed configuration update subscription mechanism, known as Live<T>.

The contract is to get a Live from the type system like this:

let live = config_system.live(|c| &c.domains.dogstatsd.debug_log)

Then you put live.changes() in your tokio select!

  _ = live.changed() => {
      let metrics_stats_enabled = live.current().metrics_stats_enable;
      self.metrics_stats_enabled = metrics_stats_enabled;
      debug!(metrics_stats_enabled, "Updated DogStatsD metrics stats debug logging gate.");

AI Summary

Adds the typed runtime configuration library and Live<T> view without wiring it into the Agent Data Plane binary.

Configuration system

The new agent-data-plane-config-system crate translates two configuration sources into the ADP-native SalukiConfiguration model:

  • Datadog configuration, translated through the generated configuration witness
  • Saluki-only configuration, which seeds fields not represented in the Datadog schema

ConfigurationSystem:

  • translates an initial GenericConfiguration into a complete typed configuration
  • subscribes to updates when the source map is dynamic
  • coalesces bursts of updates before re-translating
  • fails startup when the initial source cannot be translated
  • keeps runtime updates durable by retaining defaults for invalid translated values while applying other valid changes
  • exposes the current configuration through a shared ArcSwap

Live view of the configuration

Live<T> in agent-data-plane-config provides a typed view over a projection of SalukiConfiguration:

  • Live::fixed creates a value that never changes
  • Live::dynamic tracks a shared configuration snapshot
  • current() returns the latest projected value
  • Deref reads the view's latest snapshot
  • changed() waits for the projected value to change
  • project() narrows a view to a child node or field

The view uses ArcSwap for consistent snapshots and a Tokio watch channel for update notifications. A view only wakes its consumer when its projected value changes.

This PR is library-only. It does not modify bin/agent-data-plane, wire the configuration system into startup, add the /config/internal endpoint, or add integration-test coverage. Those changes are deferred to PR-3b, where environment handling and runtime wiring will be addressed together.

Change Type

  • Non-functional (chore, refactoring, docs)

How did you test this PR?

  • make check-clippy
  • Unit tests in agent-data-plane-config-system cover startup translation, translation errors, update convergence, projections, field-level live views, fixed views, and startup values.

No integration test is included in this PR because the Agent Data Plane wiring is deferred to PR-3b.

References

@webern webern changed the title chore(config): add the runtime configuration update system chore(config): add runtime configuration updates Jul 2, 2026
@dd-octo-sts dd-octo-sts Bot added the area/test All things testing: unit/integration, correctness, SMP regression, etc. label Jul 2, 2026
@webern webern changed the title chore(config): add runtime configuration updates chore(config): add typed configuration updates Jul 2, 2026
@webern webern changed the title chore(config): add typed configuration updates chore(config): add runtime configuration updates Jul 2, 2026
@datadog-prod-us1-6

This comment has been minimized.

@pr-commenter

pr-commenter Bot commented Jul 2, 2026

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: 98efdb26-3dfb-4d8f-993a-5857785e717e
Baseline: 2715682b · Comparison: 7f68a1a5 · 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_idle memory ⚪ +0.25 metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory ⚪ +0.17 metrics profiles logs
quality_gates_rss_dsd_low memory ⚪ +0.15 metrics profiles logs
quality_gates_rss_dsd_medium memory ⚪ -0.12 metrics profiles logs
quality_gates_rss_dsd_heavy memory ⚪ -0.13 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 133 MiB ≤ 140 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 43.2 MiB ≤ 50 MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 64.7 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 added the type/experiment A change that is still currently being worked on or tested to prove viability. label Jul 2, 2026
@pr-commenter

pr-commenter Bot commented Jul 2, 2026

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: 2715682 · Comparison: 7f68a1a · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 41.54 MiB (baseline) vs 41.54 MiB (comparison)
Size Change: +0 B (+0.00%)

✅ Binary size difference within threshold

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

@webern webern removed the type/experiment A change that is still currently being worked on or tested to prove viability. label Jul 3, 2026
@webern
webern force-pushed the m/pr3-dynamic branch 3 times, most recently from 34ab993 to 6336e2b Compare July 3, 2026 12:50
@webern
webern force-pushed the m/pr3-dynamic branch 2 times, most recently from 8b5e25b to fd414f4 Compare July 3, 2026 15:58
@webern
webern force-pushed the m/pr2-model branch 2 times, most recently from 55eedc5 to 5ca1e2d Compare July 3, 2026 17:00

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.

Base automatically changed from m/pr2-model to main July 9, 2026 13:03
@webern
webern force-pushed the m/pr3-dynamic branch 4 times, most recently from 1bae649 to 2e3fcbf Compare July 9, 2026 16:12
@webern
webern requested a review from tobz July 9, 2026 16:18
@webern

webern commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

I removed the integration with agent-data-plane because it needs more work as @tobz and the bot recognized.

This push removes the agent-data-plane touch points so I can still land the reviewed Live<T> work.

https://github.com/DataDog/saluki/compare/32eb7749c8369b102967c36c78af0ddd8947de69..7f68a1a5eb845da6dfd863aebf740de0b6394df5

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