chore(config): consolidate config maintenance to schema_overlay.yaml#1828
chore(config): consolidate config maintenance to schema_overlay.yaml#1828webern wants to merge 4 commits into
schema_overlay.yaml#1828Conversation
This comment has been minimized.
This comment has been minimized.
schema_overlay.yaml
Binary Size Analysis (Agent Data Plane)Baseline: 76d9a1e · Comparison: 817e405 · 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 (35)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 ( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f88a143a11
ℹ️ 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".
| writeln!(out, " yaml_path: \"{}\",", yaml_path).unwrap(); | ||
| writeln!(out, " aliases: &[],").unwrap(); | ||
| writeln!(out, " support_level: SupportLevel::Incompatible({}),", severity).unwrap(); | ||
| writeln!(out, " pipeline_affinity: PipelineAffinity::CrossCutting,").unwrap(); |
There was a problem hiding this comment.
Preserve pipeline affinity for investigate entries
For investigate entries with a severity, this hard-codes every generated classifier entry as cross-cutting. That changes runtime filtering in check_and_warn_config: keys such as autoscaling.failover.*, cluster_agent.enabled, and telemetry.dogstatsd_* were previously scoped to DogStatsD/Checks, but now they are considered active even for OTLP- or traces-only runs, so those configurations emit incompatible-key warnings even when the affected metrics pipelines are disabled. Carry the overlay pipeline affinity through these generated entries instead of defaulting them to CrossCutting.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I'm going to say this is fine since I don't want to keep tweaking the data model forever. Basically I added investigate as a section when I realized that sometimes the reality is we don't quite know whether something needs to be supported or not. Then I realized that sometimes we are warning on things that we need to "investigate" so I added the ability to add a severity, but made it optional.
I think if we know enough to say what the severity is, and we really need to assign specific pipelines, we should probably move it up to the unsupported sections and leave investigate for the keys we know less about.
Not a bad AI catch, though.
11594e4 to
817e405
Compare
Human Summary
This PR consolidates the ledger files and the config registry into a single source of truth, the
overlay (
schema_overlay.yaml). It generates theconfig_registry, moving it todatadog/agent/config-testsupport. The smoke tests remain and pass, but edits to the configregistry now flow through the overlay file.
Code for the runtime classification of unsupported configuration for ADP is generated separately by
datadog-agent/config. This allows for a slimmer and purpose-built structure for the productionbinary that does not have all of the test support metadata in it.
The documentation page that we have been maintaining by hand,
dogstatsd.md, is now also generated.I went to great lengths to preserve its character as much as possible, though it had drifted from
reality in some cases. Order of the main sections was preserved, but order of the prose edits was
not. Unfortunately, this is about as much as I could reduce the diff. Going forward, it will diff
mechanically with edits to the overlay.
I handled the consolidation and conflict resolution of our data with painstaking care. The config
registry was considered more authoratative than documentation or the ledger. I have been
incorporating recent changes to the data from recent PRs, but we should be vigilent against PRs that
are landing while this one is open.
A git check has been added to CI to catch in-tree code gen diffs that haven't been checked in.
AI Summary
Consolidate ADP's config metadata into a single
schema_overlay.yamland generate the configregistry + documentation from it at build time.
Before: Config metadata lived in multiple files (
ignored_keys.yaml,known-configs.json,known-configs-not-applicable.json, per-key annotation structs inconfig_registry/datadog/*.rs,and
dogstatsd.md). Updating a single key required touching up to five files with nosynchronization between them.
After: One hand-maintained YAML file (
schema_overlay.yaml) is the single source of truth.build.rsenforces completeness (everycore_schema.yamlkey must appear in the overlay) andgenerates:
dogstatsd.md)New crates
datadog-agent/config-overlay-model— Leaf crate with Rust types for deserializing andvalidating
schema_overlay.yaml. Enforces structural invariants at load time.datadog-agent/config— Prod crate. Owns the overlay file,core_schema.yaml, and abuild.rsthat generates the slim classifier array.datadog-agent/config-testsupport— Test crate. Generates full annotation constants, thesmoke test runner, and the configuration documentation from the same overlay.
What was deleted
docs/agent-data-plane/configuration/dogstatsd/known-configs.jsondocs/agent-data-plane/configuration/dogstatsd/known-configs-not-applicable.jsonconfig_registry/datadog/*.rs(replaced by generated code)saluki-components/src/config_registry/generated/directoryKey design decisions
supported,unsupported,investigate,ignored.unsupportedentries carry mandatoryseverity(low/medium/high) for runtime warn/error behaviorand mandatory
planned(bool) for documentation rendering.investigateis a parking lot for keys not yet classified with optional severity (when present,flows through classifier as
Incompatible)..tmpltemplate with in-place output for clean PR diffs.saluki-componentsno longer has aconfig_registrymodule. Code that previously usedcrate::config_registry::*now imports fromdatadog_agent_config_testsupport::config_registrydirectly.
Change Type
How did you test this PR?
References