Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5c26f00
config: add resource and propagator creation from declarative config
MikeGoldsmith Mar 13, 2026
8232012
update changelog with PR number
MikeGoldsmith Mar 13, 2026
8329ae4
fix pylint, pyright and ruff errors in resource/propagator config
MikeGoldsmith Mar 13, 2026
506d816
address review feedback: use _DEFAULT_RESOURCE, fix bool_array coercion
MikeGoldsmith Mar 16, 2026
8232d48
fix linter
MikeGoldsmith Mar 16, 2026
6ed3425
Merge branch 'main' of github.com:open-telemetry/opentelemetry-python…
MikeGoldsmith Mar 16, 2026
99753f9
address review feedback: single coercion table, simplify attributes m…
MikeGoldsmith Mar 16, 2026
8ba91d8
use Callable type annotation on _array helper
MikeGoldsmith Mar 17, 2026
516aecc
Merge remote-tracking branch 'upstream/main' into mike/config-resourc…
MikeGoldsmith Mar 20, 2026
9cfdcce
add detection infrastructure foundations for resource detectors
MikeGoldsmith Mar 20, 2026
103ff08
move service.name default into base resource
MikeGoldsmith Mar 20, 2026
7f51034
remove unused logging import from _propagator.py
MikeGoldsmith Mar 20, 2026
0a03cbd
add TracerProvider creation from declarative config
MikeGoldsmith Mar 16, 2026
90bc125
add changelog entry for PR #4985
MikeGoldsmith Mar 16, 2026
7f58ff6
fix CI lint/type failures in tracer provider config
MikeGoldsmith Mar 16, 2026
732ed92
fix pylint no-self-use on TestCreateSampler._make_provider
MikeGoldsmith Mar 16, 2026
232b06f
use allowlist for bool coercion in declarative config resource
MikeGoldsmith Mar 18, 2026
4c069b3
merge upstream/main and use shared _parse_headers from _common
MikeGoldsmith Apr 1, 2026
6f31241
address review feedback: simplify resource filter and propagator loading
MikeGoldsmith Apr 1, 2026
3fb7178
fix ruff formatting
MikeGoldsmith Apr 1, 2026
d7f8a7a
fix pyright: wrap EntryPoints in iter() for next() compatibility
MikeGoldsmith Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- `opentelemetry-sdk`: Add `create_tracer_provider`/`configure_tracer_provider` to declarative file configuration, enabling TracerProvider instantiation from config files without reading env vars
([#4985](https://github.com/open-telemetry/opentelemetry-python/pull/4985))
- `opentelemetry-sdk`: Add shared `_parse_headers` helper for declarative config OTLP exporters
([#5021](https://github.com/open-telemetry/opentelemetry-python/pull/5021))
- `opentelemetry-api`: Replace a broad exception in attribute cleaning tests to satisfy pylint in the `lint-opentelemetry-api` CI job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@
def _load_entry_point_propagator(name: str) -> TextMapPropagator:
"""Load a propagator by name from the opentelemetry_propagator entry point group."""
try:
eps = list(entry_points(group="opentelemetry_propagator", name=name))
if not eps:
ep = next(
iter(entry_points(group="opentelemetry_propagator", name=name)),
None,
)
if not ep:
raise ConfigurationError(
f"Propagator '{name}' not found. "
"It may not be installed or may be misspelled."
)
return eps[0].load()()
return ep.load()()
except ConfigurationError:
raise
except Exception as exc:
Expand Down Expand Up @@ -85,29 +88,24 @@ def create_propagator(
if config is None:
return CompositePropagator([])

propagators: list[TextMapPropagator] = []
seen_types: set[type] = set()

def _add_deduped(propagator: TextMapPropagator) -> None:
if type(propagator) not in seen_types:
seen_types.add(type(propagator))
propagators.append(propagator)
propagators: dict[type[TextMapPropagator], TextMapPropagator] = {}

# Process structured composite list
if config.composite:
for entry in config.composite:
for propagator in _propagators_from_textmap_config(entry):
_add_deduped(propagator)
propagators.setdefault(type(propagator), propagator)

# Process composite_list (comma-separated propagator names via entry_points)
if config.composite_list:
for name in config.composite_list.split(","):
name = name.strip()
if not name or name.lower() == "none":
continue
_add_deduped(_load_entry_point_propagator(name))
propagator = _load_entry_point_propagator(name)
propagators.setdefault(type(propagator), propagator)

return CompositePropagator(propagators)
return CompositePropagator(list(propagators.values()))


def configure_propagator(config: Optional[PropagatorConfig]) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,9 @@ def _filter_attributes(
if not included and not excluded:
return attrs

effective_included = included if included else None # [] → include all

result: dict[str, object] = {}
for key, value in attrs.items():
if effective_included is not None and not any(
fnmatch.fnmatch(key, pat) for pat in effective_included
):
if included and not any(fnmatch.fnmatch(key, pat) for pat in included):
continue
if excluded and any(fnmatch.fnmatch(key, pat) for pat in excluded):
continue
Expand Down
Loading
Loading