Skip to content

chore(config): migrate datadog trace encoder to typed configuration - #2187

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
m/confra-dtcfg
Aug 6, 2026
Merged

chore(config): migrate datadog trace encoder to typed configuration#2187
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
m/confra-dtcfg

Conversation

@webern

@webern webern commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Human Summary

Migrates the DatadogTraceEncoder to typed config.

AI Summary

Migrate the Datadog trace encoder to typed configuration.

  • Construct the encoder from typed shared configuration instead of GenericConfiguration.
  • Move the Agent zstd compressor setting into the shared compression model.
  • Add the ADP-specific zstd override as a typed Saluki-only setting while preserving precedence and defaults.
  • Move the trace encoder's flush timeout into shared metrics encoding configuration.
  • Remove raw deserialization and legacy smoke-test registration from the encoder.

Change Type

  • Non-functional (chore, refactoring, docs)

How did you test this PR?

  • make build-schema-overlay
  • make fmt
  • cargo check --workspace --tests
  • cargo clippy -p saluki-components -p agent-data-plane-config-system -p agent-data-plane -p agent-data-plane-config --all-targets
  • cargo nextest run -p saluki-components -p agent-data-plane-config-system -p agent-data-plane-config
  • Confirmed generated schema output has no drift

References

@dd-octo-sts dd-octo-sts Bot added area/components Sources, transforms, and destinations. encoder/datadog-traces Datadog Traces encoder. labels Jul 22, 2026
@pr-commenter

pr-commenter Bot commented Jul 22, 2026

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: c356375 · Comparison: 47e8b1a · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 41.75 MiB (baseline) vs 41.50 MiB (comparison)
Size Change: -254.65 KiB (-0.60%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
figment -239.62 KiB 212
tokio -39.99 KiB 971
&mut serde_json +30.16 KiB 35
saluki_components::transforms::dogstatsd_mapper +22.72 KiB 10
piecemeal -22.25 KiB 32
serde +22.09 KiB 30
http_body_util +19.32 KiB 57
serde_with -18.67 KiB 27
tonic -18.54 KiB 71
anon.846b21e6dda52c9a744127ddd23a5106.1184.llvm.3672468582573643209 +17.80 KiB 1
anon.36a7d0d314b9701965ea5b08796fad33.1185.llvm.15807495580778693563 -17.80 KiB 1
core +16.85 KiB 2157
[sections] -15.81 KiB 8
anon.953dae56435bf69d4ba63de4c547ae60.498.llvm.9073899492071955771 +12.37 KiB 1
anon.af90fe4baeb6e6b8384b677957b04820.462.llvm.11835343198361071145 -12.37 KiB 1
saluki_components::encoders::datadog +11.21 KiB 101
saluki_common::task::instrument -10.50 KiB 24
rmp -9.99 KiB 25
anon.36a7d0d314b9701965ea5b08796fad33.527.llvm.15807495580778693563 -9.63 KiB 1
anon.846b21e6dda52c9a744127ddd23a5106.523.llvm.3672468582573643209 +9.54 KiB 1
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  +700% +1.75Mi    _rjem_je_arena_emap_global
  [NEW] +19.9Ki  [NEW] +19.7Ki    agent_data_plane::internal::env::ADPEnvironmentProvider::from_configuration::_{{closure}}::h0631d7db0dec70b3
  [NEW] +19.8Ki  [NEW] +19.7Ki    agent_data_plane::internal::env::workload::build_collector::_{{closure}}::hfecfe48366f575fc
  [NEW] +19.5Ki  [NEW] +19.4Ki    saluki_components::transforms::apm_stats::ApmStats::process_trace::hce992ca7b6928d1d
  [NEW] +17.8Ki  [NEW]     +76    anon.846b21e6dda52c9a744127ddd23a5106.1184.llvm.3672468582573643209
  [NEW] +16.8Ki  [NEW] +16.7Ki    figment::figment::Figment::extract::h35d5a146172e5fec
  [NEW] +15.2Ki  [NEW] +15.0Ki    saluki_components::common::datadog::obfuscation::_::_<impl serde_core::de::Deserialize for saluki_components::common::datadog::obfuscation::ObfuscationConfig>::deserialize::hfdb45102b1c29886
   +69% +12.7Ki   +70% +12.7Ki    _<saluki_components::transforms::apm_stats::ApmStats as saluki_core::components::transforms::Transform>::run::_{{closure}}::h17e28c515cd1a8f5
  [NEW] +12.4Ki  [NEW]     +81    anon.953dae56435bf69d4ba63de4c547ae60.498.llvm.9073899492071955771
  [NEW] +10.7Ki  [NEW] +10.4Ki    saluki_components::encoders::datadog::traces::TraceEndpointEncoder::encode_tracer_payload::_{{closure}}::_{{closure}}::_{{closure}}::hcfc645d223e43291
  [DEL] -10.7Ki  [DEL] -10.5Ki    saluki_components::transforms::apm_stats::span_concentrator::SpanConcentrator::add_span::hc3d8ddddb323db6c
 -67.2% -11.2Ki -67.7% -11.2Ki    saluki_components::transforms::trace_obfuscation::sql::obfuscate_sql_string::hffd367895ef2885a
  [DEL] -12.4Ki  [DEL]     -81    anon.af90fe4baeb6e6b8384b677957b04820.462.llvm.11835343198361071145
  [DEL] -14.1Ki  [DEL] -13.9Ki    _<figment::value::de::ConfiguredValueDe<I> as serde_core::de::Deserializer>::deserialize_any::h9c01161bf3a4a364
  [DEL] -14.1Ki  [DEL] -14.0Ki    _<figment::value::magic::Tagged<T> as figment::value::magic::Magic>::deserialize_from::hbc114368f39b0da4
  [DEL] -14.4Ki  [DEL] -14.3Ki    _<figment::value::magic::RelativePathBuf as figment::value::magic::Magic>::deserialize_from::h57935c312d7d4142
  [DEL] -15.1Ki  [DEL] -14.9Ki    _<figment::value::de::ConfiguredValueDe<I> as serde_core::de::Deserializer>::deserialize_struct::hcd5d2f1d3886cf32
  [DEL] -16.2Ki  [DEL] -16.0Ki    saluki_components::transforms::apm_stats::span_concentrator::SpanConcentrator::flush::ha184bfce3e1498d8
  [DEL] -17.8Ki  [DEL]     -76    anon.36a7d0d314b9701965ea5b08796fad33.1185.llvm.15807495580778693563
  [DEL] -32.5Ki  [DEL] -32.4Ki    agent_data_plane::internal::env::workload::RemoteAgentWorkloadProvider::from_configuration::_{{closure}}::h273918a7d610bdfa
  -2.3%  -240Ki  -2.1%  -170Ki    [12915 Others]
  -0.6%  -254Ki  +4.7% +1.57Mi    TOTAL

@pr-commenter

pr-commenter Bot commented Jul 22, 2026

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: aaa64c04-1b21-4c57-8eb4-f7f73f36d7c0
Baseline: c3563758 · Comparison: 47e8b1a8 · 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.25 metrics profiles logs
quality_gates_rss_dsd_medium memory ⚪ -0.01 metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory ⚪ -0.30 metrics profiles logs
quality_gates_rss_dsd_heavy memory ⚪ -0.48 metrics profiles logs
quality_gates_rss_idle memory ⚪ -0.52 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 142 MiB ≤ 145 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 49.6 MiB ≤ 50 MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 77 MiB ≤ 80 MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 202 MiB ≤ 205 MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 32 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/confra-dtcfg branch 3 times, most recently from f701a86 to 100d06a Compare August 5, 2026 10:43
@dd-octo-sts dd-octo-sts Bot added encoder/buffered-incremental Buffered Incremental encoder. encoder/datadog-metrics Datadog Metrics encoder. encoder/datadog-stats Datadog APM Stats encoder. labels Aug 5, 2026
@webern
webern force-pushed the m/confra-dtcfg branch 2 times, most recently from 760cc24 to be8b6a3 Compare August 5, 2026 11:02

const fn default_flush_timeout_secs() -> u64 {
2
DEFAULT_FLUSH_TIMEOUT.as_secs()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This function will go away in favor of the config default when migrating to typed config. Right now it is just being deduplicated by a new constant.


const fn default_flush_timeout_secs() -> u64 {
2
DEFAULT_FLUSH_TIMEOUT.as_secs()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This function will go away in favor of the config default when migrating to typed config. Right now it is just being deduplicated by a new constant.

@webern
webern marked this pull request as ready for review August 5, 2026 11:32
@webern
webern requested a review from a team as a code owner August 5, 2026 11:32

@datadog-datadog-us1-prod datadog-datadog-us1-prod 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: PASS

More details

The typed trace encoder preserves the reviewed behaviors: compression precedence, two-second flush defaults and overrides, OTLP sampling normalization, environment fallback, and Error Tracking headers/tags. Package execution was blocked by unavailable Rust dependencies, so the conclusion rests on diff and call-path inspection; no concrete regression was found.

Was this helpful? React 👍 or 👎

Open Bits AI session

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

default = "default_serializer_compressor_kind"
)]
/// Compression algorithm applied to outgoing payloads.
compressor_kind: String,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we express this kind of config as an enum now with the new system?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't know where this one is coming from, but I am creating trackers for your comments. In this case, #2268. I have a feeling some things like this will fall out when working on these features in earnest.

Construct the Datadog trace encoder from typed configuration slices
instead of reading GenericConfiguration.

- Resolve the effective zstd compressor level once at the configuration
  boundary, so the encoder carries the resolved level rather than the
  Agent value and the ADP-specific override separately.
- Add a shared MetricsEncoding carrying the Saluki-only flush_timeout_secs
  key (default 2s), shared by the metrics encoders and the trace encoder.
- Take the OTLP trace settings as their own slice, since they live in the
  OTLP domain rather than the traces domain.
- Remove the encoder's raw deserialization, Datadog key names, and
  config-layer defaults; drop its config smoke-test registration while
  keeping used_by for legacy codegen.
- Update the run.rs construction call site and config registries.
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 853c1fe into main Aug 6, 2026
93 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the m/confra-dtcfg branch August 6, 2026 12:10
dd-octo-sts Bot pushed a commit that referenced this pull request Aug 6, 2026
…2187)

## Human Summary

Migrates the `DatadogTraceEncoder` to typed config.

## AI Summary

Migrate the Datadog trace encoder to typed configuration.

- Construct the encoder from typed shared configuration instead of `GenericConfiguration`.
- Move the Agent zstd compressor setting into the shared compression model.
- Add the ADP-specific zstd override as a typed Saluki-only setting while preserving precedence and defaults.
- Move the trace encoder's flush timeout into shared metrics encoding configuration.
- Remove raw deserialization and legacy smoke-test registration from the encoder.

## Change Type

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

## How did you test this PR?

- `make build-schema-overlay`
- `make fmt`
- `cargo check --workspace --tests`
- `cargo clippy -p saluki-components -p agent-data-plane-config-system -p agent-data-plane -p agent-data-plane-config --all-targets`
- `cargo nextest run -p saluki-components -p agent-data-plane-config-system -p agent-data-plane-config`
- Confirmed generated schema output has no drift

## References

- Progresses #2169
- Progresses #2193

Co-authored-by: matt.briggs <matt.briggs@datadoghq.com> 853c1fe
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. encoder/buffered-incremental Buffered Incremental encoder. encoder/datadog-metrics Datadog Metrics encoder. encoder/datadog-stats Datadog APM Stats encoder. encoder/datadog-traces Datadog Traces encoder. mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants