feat(config): wire tracer/meter/logger configurator experimental fields#5418
Draft
ocelotl wants to merge 1 commit into
Draft
feat(config): wire tracer/meter/logger configurator experimental fields#5418ocelotl wants to merge 1 commit into
ocelotl wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5390.
Description
The declarative configuration parser reads the experimental
tracer_configurator/development,meter_configurator/developmentandlogger_configurator/developmentfields into dataclass instances, butcreate_tracer_provider,create_meter_providerandcreate_logger_providerignored them — the parsed values were silently discarded.
This wires each
ExperimentalXConfiguratorinto the SDK's existing rule-basedconfigurator support:
tracers/meters/loggers) becomes aninstrumentation-scope name-glob rule (via the SDK's
_scope_name_matches_glob) carrying that scope'senabledflag.default_configsupplies the fallback config for scopes matching no glob._x_configuratorkeyword, so per-instrumentation-scopeenabledoverridesnow take effect (e.g. disabling a noisy tracer by name glob).
The logger
minimum_severityandtrace_basedfields are accepted by theconfig schema but have no equivalent in the Python SDK
_LoggerConfig(whichonly exposes
is_enabled); when set they are ignored with a warning, matchingthe existing pattern for unsupported log record
limits.Type of change
How Has This Been Tested?
Added
TestTracerConfigurator,TestMeterConfiguratorandTestLoggerConfiguratorcovering: glob-match disabling,default_configfallback for unmatched scopes, first-matching-rule-wins ordering, absent
enableddefaulting to enabled, no-configurator passthrough, and (logger) theunsupported-fields warning. Each asserts behavior through the SDK provider's
_apply_*_configurator.ruff check opentelemetry-configuration/— cleanpytest opentelemetry-configuration/tests/— 379 passed (16 new)Does This PR Require a Contrib Repo Change?
Checklist:
.changelog/5390.added)