Skip to content

feat(config): wire tracer/meter/logger configurator experimental fields#5418

Draft
ocelotl wants to merge 1 commit into
open-telemetry:mainfrom
ocelotl:issue_5390_wire_configurator_fields
Draft

feat(config): wire tracer/meter/logger configurator experimental fields#5418
ocelotl wants to merge 1 commit into
open-telemetry:mainfrom
ocelotl:issue_5390_wire_configurator_fields

Conversation

@ocelotl

@ocelotl ocelotl commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #5390.

Description

The declarative configuration parser reads the experimental
tracer_configurator/development, meter_configurator/development and
logger_configurator/development fields into dataclass instances, but
create_tracer_provider, create_meter_provider and create_logger_provider
ignored them — the parsed values were silently discarded.

This wires each ExperimentalXConfigurator into the SDK's existing rule-based
configurator support:

  • Every per-scope entry (tracers / meters / loggers) becomes an
    instrumentation-scope name-glob rule (via the SDK's
    _scope_name_matches_glob) carrying that scope's enabled flag.
  • default_config supplies the fallback config for scopes matching no glob.
  • Rules are evaluated in order, so earlier entries take precedence.
  • The resulting configurator is passed to the provider constructor through its
    _x_configurator keyword, so per-instrumentation-scope enabled overrides
    now take effect (e.g. disabling a noisy tracer by name glob).

The logger minimum_severity and trace_based fields are accepted by the
config schema but have no equivalent in the Python SDK _LoggerConfig (which
only exposes is_enabled); when set they are ignored with a warning, matching
the existing pattern for unsupported log record limits.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Added TestTracerConfigurator, TestMeterConfigurator and
TestLoggerConfigurator covering: glob-match disabling, default_config
fallback for unmatched scopes, first-matching-rule-wins ordering, absent
enabled defaulting to enabled, no-configurator passthrough, and (logger) the
unsupported-fields warning. Each asserts behavior through the SDK provider's
_apply_*_configurator.

  • ruff check opentelemetry-configuration/ — clean
  • pytest opentelemetry-configuration/tests/ — 379 passed (16 new)

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelog updated (.changelog/5390.added)
  • Unit tests have been added
  • Documentation has been updated

The declarative configuration parser reads the experimental
tracer_configurator/development, meter_configurator/development and
logger_configurator/development fields into dataclasses, but
create_tracer_provider, create_meter_provider and create_logger_provider
ignored them, so the parsed values were silently discarded.

Map each ExperimentalXConfigurator to a rule-based SDK configurator: every
per-scope entry becomes an instrumentation-scope name-glob rule carrying the
scope's enabled flag, and default_config supplies the fallback config. The
resulting configurator is passed to the provider constructor via the
_x_configurator keyword, so per-instrumentation-scope enabled overrides now
take effect.

The logger minimum_severity and trace_based fields are accepted by the schema
but unsupported by the Python SDK _LoggerConfig; they are ignored with a
warning.
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.

feat(config): wire tracer/meter/logger configurator experimental fields

1 participant