v1.43.0
📦 opentelemetry-pythonView on GitHub →
✨ 17 features🐛 4 fixes⚡ 1 deprecations🔧 15 symbols
Summary
This release significantly enhances declarative configuration support, introducing features like runtime metric reader management, dataclass conversion, and file loading via OTEL_CONFIG_FILE. It also includes numerous internal cleanups and dependency updates, such as bumping the supported protobuf version.
Migration Steps
- Replace usages of `typing.Union` and `typing.Optional` with the `|` operator in type hints.
✨ New Features
- opentelemetry-sdk: Added public APIs `add_metric_reader` and `remove_metric_reader` to register/unregister metric readers at runtime.
- opentelemetry-exporter-prometheus: Added support for configuring metric scope labels.
- opentelemetry-exporter-otlp-proto-grpc: Added gRPC error details to log messages upon gRPC call failure.
- opentelemetry-exporter-http-transport: Added 'opentelemetry-exporter-http-transport' package for HTTP exporters.
- opentelemetry-sdk: Added support for composite/development samplers in declarative file configuration.
- opentelemetry-exporter-otlp-json-file: Added OTLP JSON File exporter implementation.
- opentelemetry-sdk: Added `_resolve_component` shared utility for declarative config plugin loading.
- opentelemetry-sdk: Added pull metric reader support to declarative file configuration, including Prometheus metric reader via `prometheus_development` config field.
- opentelemetry-proto: Bumped maximum supported protobuf version to 7.x.x.
- opentelemetry-sdk: Added `ServiceInstanceIdResourceDetector` for populating `service.instance.id`.
- opentelemetry-sdk: Declarative config loader now recursively converts parsed dicts into typed dataclass instances, enabling end-to-end YAML/JSON configuration via factory functions.
- opentelemetry-sdk: Added `configure_sdk(config)` as a single entry point for declarative configuration initialization.
- opentelemetry-sdk: The declarative config loader now honors the `OTEL_CONFIG_FILE` environment variable to load configuration files.
- opentelemetry-sdk: Updated declarative config to use `ServiceInstanceIdResourceDetector`.
- opentelemetry-exporter-otlp-proto-common, opentelemetry-exporter-otlp-json-common: Encoders now always accept null and encode it as an empty `AnyValue`.
- opentelemetry-sdk: Added validation for the declarative config `file_format` version.
- opentelemetry-exporter-http-transport: Enabled entry-point loading of transport implementations.
🐛 Bug Fixes
- Added missing .rst files to Sphinx documentation build for SDK logs, propagators, and exporter submodules.
- Preserved the random trace ID flag when creating child spans.
- opentelemetry-api: Fixed SelectableGroups deprecation warning.
- opentelemetry-sdk: Made `SynchronousMeasurementConsumer.consume_measurement` lock free to avoid deadlocks.
Affected Symbols
opentelemetry-sdkopentelemetry-exporter-prometheusopentelemetry-exporter-otlp-proto-grpcopentelemetry-exporter-http-transportopentelemetry-exporter-otlp-json-fileopentelemetry-proto-jsonopentelemetry-protoServiceInstanceIdResourceDetectorconfigure_sdkopentelemetry-exporter-otlp-proto-commonopentelemetry-exporter-otlp-json-commonSynchronousMeasurementConsumeropentelemetry-apiEnvironmentGetterEnvironmentSetter
⚡ Deprecations
- Typing aliases deprecated in python 3.9 have been removed; usages of typing.Union and typing.Optional should now use the | operator.