chore(config): migrate trace sampler to typed configuration - #2191
Conversation
Build the trace sampler from the resolved traces domain slice instead of reading GenericConfiguration through the shared ApmConfig helper. - Take the sampler's probabilistic, error, priority, and rare-sampler inputs from domains.traces, and drop its raw deserialization. - Establish the Saluki-only sampler defaults in the traces model, matching ADP's historical values: default_env "none", error_sampling_enabled on, and rare_sampler tps 5, cooldown 300s, cardinality 200. - Trim ApmConfig to the span-kind, peer-tags, environment, hostname, and obfuscation surface still read by the APM stats and trace obfuscation transforms, removing the now-unused sampler fields and their legacy deserialization tests. The witnessed apm_config.probabilistic_sampling.sampling_percentage takes the Datadog schema default of 0 rather than ADP's former 100. This only affects the effective rate when the APM probabilistic sampler is enabled without an explicit percentage; the sampler is off by default.
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
More details
The migration preserves trace sampler behavior through the resolved configuration path: generated schema defaults still provide the historical 10 TPS values, while Saluki-only defaults and explicit nested settings are seeded into the traces domain. No diff-only behavioral regression was identified. No additional tests recommended: the existing configuration transport coverage already exercises the migrated Saluki-only fields, and execution was blocked by unavailable Rust dependencies.
🤖 Datadog Autotest · Commit fa6af8d · What is Autotest? · Any feedback? Reach out in #autotest
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa6af8d373
ℹ️ 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".
| let otlp_sampling_rate = normalize_sampling_rate(traces.otlp.probabilistic_sampler_sampling_percentage / 100.0); | ||
| Self { | ||
| probabilistic_sampler_enabled: traces.probabilistic_sampler.enabled, | ||
| sampling_percentage: traces.probabilistic_sampler.sampling_percentage, |
There was a problem hiding this comment.
Restore the omitted probabilistic sampler percentage fallback
When apm_config.probabilistic_sampler.enabled is set but sampling_percentage is omitted, this now copies the typed Datadog default of 0_f64 from lib/datadog-agent/config/src/generated/datadog_configuration.rs:1769; the removed raw ApmConfig default was 100%, so line 111 builds a sampling rate of 0.0 and the probabilistic path drops all non-error/non-rare traces. Preserve the previous 100% fallback for the omitted-percentage case so this typed-config cutover remains behaviorally transparent.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is correct and a bugfix that goes toward #1802. ADP should honor the core Agent defaults. Fortunately this feature isn't released to customers yet so only our tests are affected.
Binary Size Analysis (Agent Data Plane)Baseline: 0f99ce3 · Comparison: fa6af8d · diff ✅ Binary size difference within thresholdChanges by Module
Detailed Symbol Changes |
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ✅ No significant changes detectedFine details of change detection per experiment (3)Experiments configured
Bounds Checks: ✅ Passed (3)
ExplanationA 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 ( |

Human Summary
This is a relatively straightforward conversion of
TraceSamplerConfigurationto typed config. No issues were encountered. The Codex flag is because we are changing our default to match the Agent (which is what we want).AI Summary
Migrate the trace sampler transform to the typed traces configuration domain.
TraceSamplerConfigurationfromdomains.tracesinstead ofGenericConfigurationandApmConfig.ApmConfig.Change Type
How did you test this PR?
make fmtmake build-schema-overlay(no generated drift)cargo check --workspace --testscargo clippy -p saluki-components -p agent-data-plane-config-system -p agent-data-plane -p agent-data-plane-config --all-targetscargo nextest run -p saluki-components -p agent-data-plane-config-system -p agent-data-plane-config(843 passed, 1 skipped)References