chore(config): migrate OTTL filter to typed configuration - #2262
Conversation
Binary Size Analysis (Agent Data Plane)Baseline: be50909 · Comparison: 5e2ad06 · diff ✅ Binary size difference within thresholdChanges by Module
Detailed Symbol Changes |
There was a problem hiding this comment.
A typo or unknown field in ottl_filter_config used to fail configuration loading, but this migration routes it through a parser that silently falls back to propagate; the agent can therefore start while unexpectedly dropping spans. The focused Rust scenarios could not execute because the sandbox lacks the pinned toolchain/dependency, so this regression is reported from the diff and translator behavior.
🤖 Datadog Autotest · Commit 82bacae · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
| config: filter_config.unwrap_or_default(), | ||
| }) | ||
| /// Creates configuration from the resolved typed traces configuration. | ||
| pub fn from_configuration(config: &TypedOttlFilter) -> Self { |
There was a problem hiding this comment.
Invalid filter configuration no longer fails startup
A malformed production configuration can silently discard spans and hide the operator's typo rather than preventing startup with an actionable error.
Assertion details
- Input: A deployment sets
ottl_filter_config.error_modeto an unsupported value such asexplode, or includes an unknown field underottl_filter_config. - Expected: Configuration loading rejects the invalid filter configuration before the agent starts, matching the removed adapter's enum parsing and
deny_unknown_fieldsbehavior. - Actual: The new adapter accepts an already-resolved
TypedOttlFilterwithout validation, while the typed source translator maps any unrecognized error mode toOttlErrorMode::Propagateand permits unknown fields. The agent starts and treats the typo as propagate, causing evaluation errors to drop spans instead of surfacing a configuration error.
Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
There was a problem hiding this comment.
I opened an issue at #2278 to follow up on where these configs are coming from. But for now fixed (see below)
Sonnet:
Fixed by strengthening the typed config layer instead of the component:
ottl_filter_config.error_mode/ottl_transform_config.error_modenow deserialize through a dedicatedOttlErrorModeSourceenum (insaluki_only.rs) rather thanOption<String>, so an unrecognized value (e.g.ignroe) is a deserialization error instead of a silent fallback toPropagate.OttlFilterConfig,OttlFilterTraces, andOttlTransformConfigalso gaineddeny_unknown_fields, restoring the old adapter's rejection of unknown keys (e.g. a straytraces.spaneventblock). Startup translation is strict, so either failure mode now fails config load before the agent starts, matching the removed adapter's behavior. Added regression tests covering both cases plus an environment-variable round-trip for the new enum leaf.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82bacaec81
ℹ️ 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 trace_obfuscation_config = | ||
| TraceObfuscationConfiguration::from_configuration(&config.domains.traces.obfuscation); | ||
|
|
||
| let ottl_filter_config = OttlFilterConfiguration::from_configuration(&config.domains.traces.ottl_filter); |
There was a problem hiding this comment.
Preserve OTTL filter config validation
With this call now consuming config.domains.traces.ottl_filter, invalid filter config no longer goes through the old serde type that had deny_unknown_fields and an enum for error_mode; the typed Saluki-only model stores error_mode as Option<String> and maps anything else to Propagate. In configs with a typo such as error_mode: ignroe or an unsupported traces.spanevent block, ADP now boots with the default/no-op typed value instead of failing fast, and evaluation errors can start dropping spans unexpectedly. Keep the previous validation at the typed boundary before handing the value to the component.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I opened an issue at #2278 to follow up on where these configs are coming from. But for now fixed (see below)
Sonnet:
Fixed by strengthening the typed config layer instead of the component:
ottl_filter_config.error_mode/ottl_transform_config.error_modenow deserialize through a dedicatedOttlErrorModeSourceenum (insaluki_only.rs) rather thanOption<String>, so an unrecognized value (e.g.ignroe) is a deserialization error instead of a silent fallback toPropagate.OttlFilterConfig,OttlFilterTraces, andOttlTransformConfigalso gaineddeny_unknown_fields, restoring the old adapter's rejection of unknown keys (e.g. a straytraces.spaneventblock). Startup translation is strict, so either failure mode now fails config load before the agent starts, matching the removed adapter's behavior. Added regression tests covering both cases plus an environment-variable round-trip for the new enum leaf.
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ✅ No significant changes detectedFine details of change detection per experiment (5)Experiments configured
Bounds Checks: ✅ Passed (5)
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 ( |
1005c62 to
fedf507
Compare
9b18bd0 to
e7805fa
Compare
There was a problem hiding this comment.
More details
The typed boundary retains the valid OTTL filter modes and conditions used by the existing correctness and SMP configurations, while enum discovery makes DD_OTTL_FILTER_CONFIG_ERROR_MODE reachable. No additional tests recommended: production inputs were unavailable and execution was blocked by unavailable toolchain/dependency downloads.
🤖 Datadog Autotest · Commit 8a4f36d · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
## Summary Migrate the OTTL span filter processor to the typed traces configuration. The processor now receives typed error-mode and span-condition values, and its raw configuration adapter is removed. ## Change Type - [x] Non-functional (chore, refactoring, docs) ## How did you test this PR? - `make fmt` - `make check-docs` - `make check-clippy` - `make check-all` - OTTL filter tests: 13 passed - `cargo check -p agent-data-plane --tests` ## References - Progresses #2169 - Progresses #2193 2ce0908

Summary
Migrate the OTTL span filter processor to the typed traces configuration. The processor now receives typed error-mode and span-condition values, and its raw configuration adapter is removed.
Change Type
How did you test this PR?
make fmtmake check-docsmake check-clippymake check-allcargo check -p agent-data-plane --testsReferences