Skip to content

Commit 8f47a77

Browse files
committed
merge upstream/main
Assisted-by: Claude Sonnet 4.6
2 parents 7375dff + 37dea4b commit 8f47a77

19 files changed

Lines changed: 2510 additions & 95 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
- `opentelemetry-sdk`: Add `create_logger_provider`/`configure_logger_provider` to declarative file configuration, enabling LoggerProvider instantiation from config files without reading env vars
1616
([#4990](https://github.com/open-telemetry/opentelemetry-python/pull/4990))
17+
- `opentelemetry-sdk`: Add `host` resource detector support to declarative file configuration via `detection_development.detectors[].host`
18+
([#5002](https://github.com/open-telemetry/opentelemetry-python/pull/5002))
19+
- `opentelemetry-sdk`: Add `container` resource detector support to declarative file configuration via `detection_development.detectors[].container`, using entry point loading of the `opentelemetry-resource-detector-containerid` contrib package
20+
([#5004](https://github.com/open-telemetry/opentelemetry-python/pull/5004))
21+
- `opentelemetry-sdk`: Add `create_tracer_provider`/`configure_tracer_provider` to declarative file configuration, enabling TracerProvider instantiation from config files without reading env vars
22+
([#4985](https://github.com/open-telemetry/opentelemetry-python/pull/4985))
1723
- Enabled the flake8-tidy-import plugins rules for the ruff linter. These rules throw warnings for relative imports in the modules.
1824
([#5019](https://github.com/open-telemetry/opentelemetry-python/pull/5019))
1925
- `opentelemetry-sdk`: Fix `AttributeError` in `ExplicitBucketHistogramAggregation` when applied to non-Histogram instruments without explicit boundaries
@@ -25,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2531
- `opentelemetry-sdk`: Add shared `_parse_headers` helper for declarative config OTLP exporters
2632
([#5021](https://github.com/open-telemetry/opentelemetry-python/pull/5021))
2733
- `opentelemetry-api`: Replace a broad exception in attribute cleaning tests to satisfy pylint in the `lint-opentelemetry-api` CI job
34+
- `opentelemetry-sdk`: Add `create_meter_provider`/`configure_meter_provider` to declarative file configuration, enabling MeterProvider instantiation from config files without reading env vars
35+
([#4987](https://github.com/open-telemetry/opentelemetry-python/pull/4987))
2836
- `opentelemetry-sdk`: Add `create_resource` and `create_propagator`/`configure_propagator` to declarative file configuration, enabling Resource and propagator instantiation from config files without reading env vars
2937
([#4979](https://github.com/open-telemetry/opentelemetry-python/pull/4979))
3038
- `opentelemetry-sdk`: Map Python `CRITICAL` log level to OTel `FATAL` severity text per the specification
@@ -63,6 +71,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6371
([#5007](https://github.com/open-telemetry/opentelemetry-python/pull/5007))
6472
- Redo OTLPMetricExporter unit tests of `max_export_batch_size` to use real `export`
6573
([#5036](https://github.com/open-telemetry/opentelemetry-python/pull/5036))
74+
- `opentelemetry-sdk`: Implement experimental Logger configurator
75+
([#4980](https://github.com/open-telemetry/opentelemetry-python/pull/4980))
6676

6777
## Version 1.40.0/0.61b0 (2026-03-04)
6878

README.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -125,28 +125,23 @@ For more information about the maintainer role, see the [community repository](h
125125

126126
For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver).
127127

128-
### Emeritus Maintainers
129-
130-
- [Alex Boten](https://github.com/codeboten)
131-
- [Chris Kleinknecht](https://github.com/c24t)
132-
- [Diego Hurtado](https://github.com/ocelotl)
133-
- [Owais Lone](https://github.com/owais)
134-
- [Reiley Yang](https://github.com/reyang)
135-
- [Srikanth Chekuri](https://github.com/srikanthccv)
136-
- [Yusuke Tsutsumi](https://github.com/toumorokoshi)
137-
138-
For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).
139-
140-
### Emeritus Approvers
141-
142-
- [Ashutosh Goel](https://github.com/ashu658)
143-
- [Carlos Alberto Cortez](https://github.com/carlosalberto)
144-
- [Christian Neumüller](https://github.com/Oberon00)
145-
- [Mauricio Vásquez](https://github.com/mauriciovasquezbernal)
146-
- [Nathaniel Ruiz Nowell](https://github.com/NathanielRN)
147-
- [Nikolay Sokolik](https://github.com/oxeye-nikolay)
148-
- [Sanket Mehta](https://github.com/sanketmehta28)
149-
- [Tahir H. Butt](https://github.com/majorgreys)
128+
### Emeritus
129+
130+
- [Alex Boten](https://github.com/codeboten), Maintainer
131+
- [Ashutosh Goel](https://github.com/ashu658), Approver
132+
- [Carlos Alberto Cortez](https://github.com/carlosalberto), Approver
133+
- [Chris Kleinknecht](https://github.com/c24t), Maintainer
134+
- [Christian Neumüller](https://github.com/Oberon00), Approver
135+
- [Diego Hurtado](https://github.com/ocelotl), Maintainer
136+
- [Mauricio Vásquez](https://github.com/mauriciovasquezbernal), Approver
137+
- [Nathaniel Ruiz Nowell](https://github.com/NathanielRN), Approver
138+
- [Nikolay Sokolik](https://github.com/oxeye-nikolay), Approver
139+
- [Owais Lone](https://github.com/owais), Maintainer
140+
- [Reiley Yang](https://github.com/reyang), Maintainer
141+
- [Sanket Mehta](https://github.com/sanketmehta28), Approver
142+
- [Srikanth Chekuri](https://github.com/srikanthccv), Maintainer
143+
- [Tahir H. Butt](https://github.com/majorgreys), Approver
144+
- [Yusuke Tsutsumi](https://github.com/toumorokoshi), Maintainer
150145

151146
For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).
152147

codegen/opentelemetry-codegen-json/src/opentelemetry/codegen/json/version/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.61b0.dev"
15+
__version__ = "0.62b0.dev"

opentelemetry-proto-json/src/opentelemetry/proto_json/version/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.61b0.dev"
15+
__version__ = "0.62b0.dev"

opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
LoggingHandler,
4343
LogRecordProcessor,
4444
)
45+
from opentelemetry.sdk._logs._internal import _LoggerConfiguratorT
4546
from opentelemetry.sdk._logs.export import (
4647
BatchLogRecordProcessor,
4748
LogRecordExporter,
@@ -52,6 +53,7 @@
5253
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL,
5354
OTEL_EXPORTER_OTLP_PROTOCOL,
5455
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL,
56+
OTEL_PYTHON_LOGGER_CONFIGURATOR,
5557
OTEL_PYTHON_METER_CONFIGURATOR,
5658
OTEL_PYTHON_TRACER_CONFIGURATOR,
5759
OTEL_TRACES_SAMPLER,
@@ -177,6 +179,10 @@ def _get_meter_configurator() -> str | None:
177179
return environ.get(OTEL_PYTHON_METER_CONFIGURATOR, None)
178180

179181

182+
def _get_logger_configurator() -> str | None:
183+
return environ.get(OTEL_PYTHON_LOGGER_CONFIGURATOR, None)
184+
185+
180186
def _get_exporter_entry_point(
181187
exporter_name: str, signal_type: Literal["traces", "metrics", "logs"]
182188
):
@@ -297,6 +303,7 @@ def _init_metrics(
297303
set_meter_provider(provider)
298304

299305

306+
# pylint: disable-next=too-many-locals
300307
def _init_logging(
301308
exporters: dict[str, Type[LogRecordExporter]],
302309
resource: Resource | None = None,
@@ -305,8 +312,11 @@ def _init_logging(
305312
log_record_processors: Sequence[LogRecordProcessor] | None = None,
306313
export_log_record_processor: _ConfigurationExporterLogRecordProcessorT
307314
| None = None,
315+
logger_configurator: _LoggerConfiguratorT | None = None,
308316
):
309-
provider = LoggerProvider(resource=resource)
317+
provider = LoggerProvider(
318+
resource=resource, _logger_configurator=logger_configurator
319+
)
310320
set_logger_provider(provider)
311321

312322
exporter_args_map = exporter_args_map or {}
@@ -377,6 +387,27 @@ def overwritten_config_fn(*args, **kwargs):
377387
logging.basicConfig = wrapper(logging.basicConfig)
378388

379389

390+
def _import_logger_configurator(
391+
logger_configurator_name: str | None,
392+
) -> _LoggerConfiguratorT | None:
393+
if not logger_configurator_name:
394+
return None
395+
396+
try:
397+
_, logger_configurator_impl = _import_config_components(
398+
[logger_configurator_name.strip()],
399+
"_opentelemetry_logger_configurator",
400+
)[0]
401+
except Exception as exc: # pylint: disable=broad-exception-caught
402+
_logger.warning(
403+
"Using default logger configurator. Failed to load logger configurator, %s: %s",
404+
logger_configurator_name,
405+
exc,
406+
)
407+
return None
408+
return logger_configurator_impl
409+
410+
380411
def _import_tracer_configurator(
381412
tracer_configurator_name: str | None,
382413
) -> _TracerConfiguratorT | None:
@@ -540,6 +571,7 @@ def _initialize_components(
540571
| None = None,
541572
tracer_configurator: _TracerConfiguratorT | None = None,
542573
meter_configurator: _MeterConfiguratorT | None = None,
574+
logger_configurator: _LoggerConfiguratorT | None = None,
543575
):
544576
# pylint: disable=too-many-locals
545577
if trace_exporter_names is None:
@@ -576,6 +608,11 @@ def _initialize_components(
576608
meter_configurator = _import_meter_configurator(
577609
meter_configurator_name
578610
)
611+
if logger_configurator is None:
612+
logger_configurator_name = _get_logger_configurator()
613+
logger_configurator = _import_logger_configurator(
614+
logger_configurator_name
615+
)
579616

580617
# if env var OTEL_RESOURCE_ATTRIBUTES is given, it will read the service_name
581618
# from the env variable else defaults to "unknown_service"
@@ -613,6 +650,7 @@ def _initialize_components(
613650
exporter_args_map=exporter_args_map,
614651
log_record_processors=log_record_processors,
615652
export_log_record_processor=export_log_record_processor,
653+
logger_configurator=logger_configurator,
616654
)
617655

618656

0 commit comments

Comments
 (0)