Skip to content

chore(components): migrate DogStatsD source to full supervision - #2385

Open
tobz wants to merge 1 commit into
mainfrom
tobz/component-sup-cutover-phase-3
Open

chore(components): migrate DogStatsD source to full supervision#2385
tobz wants to merge 1 commit into
mainfrom
tobz/component-sup-cutover-phase-3

Conversation

@tobz

@tobz tobz commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

This PR is the third of many (hopefully just a few) for converting components to spawn all of their child tasks under their dedicated supervisor to fully unify task execution in Saluki under the supervision tree model, specifically handling the DogStatsD source.

We skipped the DogStatsD source in the initial sources/relay migration PR because it's very beefy, and deserves its own standalone PR.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

How did you test this PR?

Existing tests.

References

DADP-2

@dd-octo-sts dd-octo-sts Bot added area/components Sources, transforms, and destinations. source/dogstatsd DogStatsD source. labels Aug 20, 2026

tobz commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

@pr-commenter

pr-commenter Bot commented Aug 20, 2026

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: 0384c33 · Comparison: 5d45df0 · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 41.25 MiB (baseline) vs 41.19 MiB (comparison)
Size Change: -56.95 KiB (-0.13%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
figment -57.24 KiB 54
tracing -53.05 KiB 31
saluki_core::runtime::workers +44.30 KiB 23
saluki_components::sources::dogstatsd +42.55 KiB 59
tokio -38.41 KiB 736
otlp_protos::otlp_include::opentelemetry -26.85 KiB 113
tonic +23.12 KiB 41
http_body_util -17.54 KiB 26
anon.5acabfac6d79e86a87fa9c42e93ba25f.983.llvm.18022061730132125650 +17.45 KiB 1
anon.5acabfac6d79e86a87fa9c42e93ba25f.983.llvm.8585410731666136712 -17.45 KiB 1
anyhow +15.23 KiB 154
axum -13.11 KiB 51
http -13.01 KiB 27
core +12.45 KiB 1726
anon.5acabfac6d79e86a87fa9c42e93ba25f.988.llvm.18022061730132125650 +12.37 KiB 1
anon.5acabfac6d79e86a87fa9c42e93ba25f.988.llvm.8585410731666136712 -12.28 KiB 1
saluki_components::encoders::datadog +10.34 KiB 48
saluki_context::resolver::ContextResolver -10.33 KiB 4
saluki_common::cache::CacheBuilder<K,V,W,H> +10.24 KiB 4
rmp +9.71 KiB 14
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW] +34.8Ki  [NEW] +34.5Ki    _<saluki_components::sources::dogstatsd::_::<impl serde_core::de::Deserialize for saluki_components::sources::dogstatsd::DogStatsDConfiguration>::deserialize::__Visitor as serde_core::de::Visitor>::visit_map::h71b8b14f8fe676df
  [NEW] +20.1Ki  [NEW] +19.9Ki    saluki_core::runtime::workers::noninterruptible_worker::_{{closure}}::_{{closure}}::hc919fbe93619ca0a
  [NEW] +19.2Ki  [NEW] +19.1Ki    h2::proto::connection::Connection<T,P,B>::poll::h41693c50a5e2e6a5
  +301% +18.2Ki  +307% +18.2Ki    h2::proto::connection::DynConnection<B>::recv_frame::h5569cd28715d21f3
  [NEW] +17.5Ki  [NEW]     +76    anon.5acabfac6d79e86a87fa9c42e93ba25f.983.llvm.18022061730132125650
  [NEW] +17.2Ki  [NEW] +17.1Ki    h2::proto::connection::Connection<T,P,B>::poll::h2e3c8ca5e1a0a93e
  [NEW] +15.4Ki  [NEW] +15.2Ki    saluki_core::runtime::workers::noninterruptible_worker::_{{closure}}::_{{closure}}::h83b3da3366e34314
  [NEW] +12.4Ki  [NEW]     +81    anon.5acabfac6d79e86a87fa9c42e93ba25f.988.llvm.18022061730132125650
  [NEW] +9.96Ki  [NEW] +9.83Ki    saluki_components::transforms::apm_stats::span_concentrator::SpanConcentrator::flush::hb47f5dc465a13918
 +12e2% +9.46Ki +13e2% +9.46Ki    prost::message::Message::decode::h69d79adb9bd80dcf
  [NEW] +9.12Ki  [NEW] +8.99Ki    _<core::future::poll_fn::PollFn<F> as core::future::future::Future>::poll::h8104c67e547e4217
  [DEL] -10.6Ki  [DEL] -10.5Ki    _<tracing::instrument::Instrumented<T> as core::future::future::Future>::poll::h80c2eda1571612c8
  [DEL] -11.8Ki  [DEL] -11.7Ki    h2::server::Connection<T,B>::poll_closed::hcdb28a9fd1dd53ad
  [DEL] -12.3Ki  [DEL]     -81    anon.5acabfac6d79e86a87fa9c42e93ba25f.988.llvm.8585410731666136712
  [DEL] -12.9Ki  [DEL] -12.8Ki    h2::server::Connection<T,B>::poll_closed::h11fd495c293c3043
 -40.5% -13.0Ki -40.7% -13.0Ki    _<saluki_components::transforms::apm_stats::ApmStats as saluki_core::components::transforms::Transform>::run::_{{closure}}::hf2e1067e9305fcf4
  [DEL] -16.0Ki  [DEL] -15.8Ki    saluki_components::transforms::apm_stats::ApmStats::process_trace::hd369f1bfa3073d0a
  [DEL] -17.4Ki  [DEL]     -76    anon.5acabfac6d79e86a87fa9c42e93ba25f.983.llvm.8585410731666136712
  [DEL] -18.0Ki  [DEL] -17.9Ki    _<tracing::instrument::Instrumented<T> as core::future::future::Future>::poll::h7466185b0d228024
  [DEL] -22.7Ki  [DEL] -22.6Ki    _<figment::value::de::ConfiguredValueDe<I> as serde_core::de::Deserializer>::deserialize_any::h8e9b8330c1d94c85
  -1.4%  -105Ki  -1.5% -92.0Ki    [8280 Others]
  -0.1% -56.9Ki  -0.1% -44.0Ki    TOTAL

@pr-commenter

pr-commenter Bot commented Aug 20, 2026

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: 330e634e-3f43-45e3-ba2e-809c86ccc849
Baseline: 0384c331 · Comparison: 5d45df06 · 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_heavy memory ⚪ +0.35 metrics profiles logs
quality_gates_rss_dsd_medium memory ⚪ +0.13 metrics profiles logs
quality_gates_rss_idle memory ⚪ +0.13 metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory ⚪ -0.39 metrics profiles logs
quality_gates_rss_dsd_low memory ⚪ -0.53 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 232 MiB ≤ 250 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 52.9 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 ✅ 397 MiB ≤ 420 MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 34.3 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.

@tobz
tobz force-pushed the tobz/component-sup-cutover-phase-3 branch from fabcbea to 51f8d08 Compare August 21, 2026 15:46
@tobz
tobz force-pushed the tobz/component-sup-cutover-phase-2 branch from c6e5b1d to b791a89 Compare August 21, 2026 15:46
@tobz
tobz force-pushed the tobz/component-sup-cutover-phase-3 branch from 51f8d08 to 6a54d37 Compare August 21, 2026 16:24
@tobz
tobz force-pushed the tobz/component-sup-cutover-phase-2 branch from b791a89 to a75a48a Compare August 21, 2026 16:24
Base automatically changed from tobz/component-sup-cutover-phase-2 to main August 24, 2026 17:59
@tobz
tobz force-pushed the tobz/component-sup-cutover-phase-3 branch from 6a54d37 to 5b6bf70 Compare August 24, 2026 19:02
@tobz
tobz marked this pull request as ready for review August 24, 2026 19:18
@tobz
tobz force-pushed the tobz/component-sup-cutover-phase-3 branch from 5b6bf70 to 5d45df0 Compare August 24, 2026 19:18
@tobz
tobz requested a review from a team as a code owner August 24, 2026 19:18
@tobz tobz added the type/chore Updates to dependencies or general "administrative" tasks necessary to maintain the codebase/repo. label Aug 24, 2026

@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: 5d45df06eb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +163 to +165
if let Err(e) = spawner
.spawn_interruptible("packet_forwarder", forwarder.run(packets_rx, self.metrics.clone()))
.await

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Drain queued forwarding packets before supervisor exit

When the component supervisor begins its concurrent shutdown, spawn_interruptible drops ConnectedPacketForwarder::run at its current await point, so any DogStatsD messages already accepted into packets_rx are discarded instead of being sent. The previous detached loop remained alive until the listener/handler-held senders closed and then drained the channel; use a non-interruptible child that finishes after channel closure, or explicitly coordinate this queue's drain before shutdown completes.

Useful? React with 👍 / 👎.

@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.

Datadog Autotest: FAIL

Shutdown can stop the packet forwarder before DogStatsD decoders finish their lossless drain. This can lose queued metrics.

Open Bits AI session

🤖 Datadog Autotest · Commit 5d45df0 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

forwarder.run(packets_rx, self.metrics.clone()),
);
if let Err(e) = spawner
.spawn_interruptible("packet_forwarder", forwarder.run(packets_rx, self.metrics.clone()))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Keep the forwarder active during queue drain

DogStatsD packet forwarding can lose metrics during shutdown.

Assertion details
  • Input: Packet forwarding is enabled. Shutdown starts while a decoder or the forwarder queue still has packets.
  • Expected: The forwarder stays active until all packet senders close. It sends all queued packets before it stops.
  • Actual: The supervisor stops the interruptible forwarder at once. The decoders continue their queue drain. Later sends fail, and packets already in the forwarder queue are lost. Make the forward loop non-interruptible until all senders close. Update the forwarder shutdown tests to release the sender before supervisor shutdown. Add coverage for queue drain during shutdown.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/components Sources, transforms, and destinations. source/dogstatsd DogStatsD source. type/chore Updates to dependencies or general "administrative" tasks necessary to maintain the codebase/repo.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant