oss_24_declarative_config_present_null_defaults#34
Conversation
…ults A present-but-null YAML value (e.g. `console:` with no value) previously mapped to `None` during dict-to-dataclass conversion, making it indistinguishable from an absent key. Component factories select on `value is not None`, so a present-null component raised a ConfigurationError instead of building the component with defaults. The configuration spec requires parsing to distinguish a missing key from a present-null one, and a present-null component MUST be created with all defaults. Because `_convert_value` is only invoked for keys that are actually present (absent keys fall through to dataclass field defaults), a `None` value there always means present-null. It is now carried through as: - a defaults-only dataclass instance for dataclass-typed fields, - an empty mapping for mapping-alias fields (e.g. the console exporter), - `None` for primitives (already their use-default value). Absent keys remain `None`, preserving 'not configured' semantics.
|
🔒 Internal (dash0) — not for upstream.
|
|
📣 Public-facing draft — to be used for the upstream PR in Title: Fix declarative config present-but-null components to build with defaults WhatMake a present-but-null component value in declarative configuration build that component with defaults, instead of raising WhyA present-but-null value (e.g. Spec
How
TestsNew unit tests in |
Closes #31
Declarative config: a present-but-null component (e.g.
console:with no value) now builds that component with defaults instead of raising ConfigurationError; present-null is carried through conversion distinctly from an absent key (Linear OSS-24, finding L1).Validation: scope contained to opentelemetry-configuration + changelog; full package suite 369 passed.
Linear issue: https://linear.app/dash0/issue/OSS-24/l1-declarative-config-present-but-null-components-fail-instead-of