Skip to content

oss_25_declarative_config_configprovider_create#45

Open
ocelotl wants to merge 2 commits into
mainfrom
oss_25_declarative_config_configprovider_create
Open

oss_25_declarative_config_configprovider_create#45
ocelotl wants to merge 2 commits into
mainfrom
oss_25_declarative_config_configprovider_create

Conversation

@ocelotl

@ocelotl ocelotl commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Closes #38

Declarative config: add a stateless create(model) -> Providers that builds providers without mutating globals (configure_sdk() now delegates to it then installs globals), plus ConfigProperties/ConfigProvider typed read view over the .instrumentation node (Linear OSS-25, finding L8).

Validation: scope contained to opentelemetry-configuration + changelog; package suite 392 passed.

Linear issue: https://linear.app/dash0/issue/OSS-25/l8-declarative-config-no-configproviderconfigproperties-api-no-pure

…config

Add a stateless create(model) -> Providers that builds the SDK providers
without mutating global state, and have configure_sdk() reuse it (build via
create, then install the built providers as the process globals and run
instrumentation).

Add a ConfigProperties read view over the parsed instrumentation node with
typed getters (get_string/get_bool/get_int/get_float/get_config/
get_config_list/get_scalar_list/keys) that return None on missing key or
type mismatch, and a global ConfigProvider exposing the instrumentation
config.
@ocelotl

ocelotl commented Jul 22, 2026

Copy link
Copy Markdown
Owner Author

🔒 Internal (dash0) — not for upstream.

@ocelotl

ocelotl commented Jul 22, 2026

Copy link
Copy Markdown
Owner Author

📣 Public-facing draft — to be used for the upstream PR in open-telemetry/opentelemetry-python. No internal references; copy verbatim.

Title: Add pure create() and ConfigProvider/ConfigProperties to declarative config

What

Adds a stateless create(model) -> Providers to opentelemetry-configuration and a ConfigProvider / ConfigProperties API for reading declarative instrumentation config.

  • create(config) builds the tracer/meter/logger providers, the propagator, and a ConfigProvider from a parsed OpenTelemetryConfiguration, returning them in a Providers bundle without touching global state. Absent sections yield None providers (spec "noop default"); the propagator is always built.
  • configure_sdk(config) now delegates to create(), then installs the built providers as process globals and runs instrumentation. Behavior unchanged for existing callers.
  • ConfigProperties wraps the parsed .instrumentation node with typed getters (get_string, get_bool, get_int, get_float, get_config, get_config_list, get_scalar_list, keys), each returning None on missing key or type mismatch. ConfigProvider exposes it via set_config_provider/get_config_provider.

Why

Separates building providers from installing them (enabling embedding and testing without side effects) and gives instrumentation libraries a standard, spec-shaped read view over declarative instrumentation config.

Spec / reference

configuration/api.md (ConfigProvider/ConfigProperties, Stable) and sdk.md; mirrors Java's DeclarativeConfiguration.parse()/create() and DeclarativeConfigProperties.

Tests

New create() tests (providers returned, no global mutation, instrumentation config exposed); new ConfigProperties tests (typed getters + null/type-mismatch); existing configure_sdk tests updated to the new install flow. Full package suite: 392 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oss_25_declarative_config_configprovider_create

1 participant