feat(config): propagator plugin loading via entry points for declarative config (#5098)
* add shared load_entry_point util for declarative config plugin loading
Extracts a generic `load_entry_point(group, name)` helper into `_common`
so that resource detector, exporter, propagator, and sampler plugin loading
in declarative file config can all use the same entry point lookup pattern
rather than duplicating it.
Refactors `_propagator.py` to use the new util, removing its inline
entry point lookup.
Assisted-by: Claude Sonnet 4.6
* update CHANGELOG with PR number #5093
Assisted-by: Claude Sonnet 4.6
* add propagator plugin loading to declarative config via entry points
TextMapPropagator is changed from @dataclass to TypeAlias = dict[str, Any]
in models.py, preserving unknown propagator names (plugin names) as dict
keys through the config pipeline — same approach as Sampler.
_propagators_from_textmap_config() now iterates the dict's key-value pairs
directly. Known names (tracecontext, baggage) are bootstrapped from
_PROPAGATOR_REGISTRY. All other names — including b3, b3multi, and custom
plugin propagators — fall back to load_entry_point("opentelemetry_propagator",
name), matching the spec's PluginComponentProvider mechanism.
Assisted-by: Claude Sonnet 4.6
* revert models.py changes, use raw dicts without modifying codegen
Python dataclasses don't enforce types at runtime, so factory
functions can accept raw dicts directly. This removes the need to
change TextMapPropagator from a @dataclass to a TypeAlias.
Assisted-by: Claude Opus 4.6 (1M context)
* update propagator plugin loading to use additional_properties
Use typed TextMapPropagatorConfig with additional_properties from
the @_additional_properties decorator instead of raw dict iteration.
Known propagators (tracecontext, baggage) are checked via typed fields
and _PROPAGATOR_REGISTRY. Known schema fields not in the registry
(b3, b3multi) and unknown plugin names from additional_properties
are loaded via entry points.
Assisted-by: Claude Opus 4.6
* fix: use .items() in propagator registry loop
* address review: store types directly in propagator registry
Registry now maps names to propagator classes instead of lambdas,
since tracecontext and baggage take no config args. Removes
unnecessary lambda wrapper.
Assisted-by: Claude Opus 4.6
* pass plugin config args to entry point propagators
Plugin propagators now receive their config as kwargs:
load_entry_point("group", name)(**(plugin_config or {}))
Previously config values were discarded.
Assisted-by: Claude Opus 4.6
---------
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> M
Mike Goldsmith committed
990a6112a124e53cc0e3f66871ce8f8d00955d15
Parent: 85eb40a
Committed by GitHub <noreply@github.com>
on 5/15/2026, 1:42:47 PM