v1.41.0
Breaking Changes📦 opentelemetry-pythonView on GitHub →
⚠ 2 breaking✨ 12 features🐛 10 fixes🔧 26 symbols
Summary
This release introduces extensive support for declarative configuration in `opentelemetry-sdk`, enabling instantiation of providers, resources, and propagators via YAML/JSON files. It also adjusts the default log batch export delay to align with the OTel specification.
⚠️ Breaking Changes
- The default `schedule_delay_millis` for `BatchLogRecordProcessor` changed from 5000ms to 1000ms to comply with the OTel specification. Logs may now be exported 5x more frequently by default if the environment variable `OTEL_BLRP_SCHEDULE_DELAY` was not explicitly set.
- Internal interface change in `opentelemetry-sdk`: TracerConfig is now cached into the tracer. This means only one Tracer with the same instrumentation scope will be created.
Migration Steps
- If you rely on `BatchLogRecordProcessor` exporting logs at a maximum delay of 5 seconds, you must now explicitly set the environment variable `OTEL_BLRP_SCHEDULE_DELAY` to `5000`.
- If you were relying on the internal mechanism that created multiple Tracer instances for the same scope, be aware that only one Tracer instance per instrumentation scope will now be created due to TracerConfig caching.
✨ New Features
- Added support for `host` resource detector in declarative file configuration via `detection_development.detectors[].host` in `opentelemetry-sdk`.
- Added support for `container` resource detector in declarative file configuration via `detection_development.detectors[].container` in `opentelemetry-sdk`, utilizing entry point loading from `opentelemetry-resource-detector-containerid`.
- Added `create_tracer_provider`/`configure_tracer_provider` to declarative file configuration in `opentelemetry-sdk`, allowing TracerProvider instantiation from config files without relying on environment variables.
- Added support for `process` resource detector in declarative file configuration via `detection_development.detectors[].process` in `opentelemetry-sdk`.
- Added `create_meter_provider`/`configure_meter_provider` to declarative file configuration in `opentelemetry-sdk`, enabling MeterProvider instantiation from config files without reading env vars.
- Added `create_resource` and `create_propagator`/`configure_propagator` to declarative file configuration in `opentelemetry-sdk`, enabling Resource and propagator instantiation from config files without reading env vars.
- Added file configuration support (YAML/JSON loading, environment variable substitution, schema validation) to `opentelemetry-sdk`.
- Added deepcopy support for `BoundedAttributes` and `BoundedList` in `opentelemetry-api` and `opentelemetry-sdk`.
- Implemented custom protoc plugin in `opentelemetry-proto-json` and `opentelemetry-codegen-json` to generate OTLP JSON class definitions.
- Added configurable `max_export_batch_size` to OTLP HTTP metrics exporter.
- Implemented experimental Meter configurator in `opentelemetry-sdk`.
- Implemented experimental Logger configurator in `opentelemetry-sdk`.
🐛 Bug Fixes
- Fixed `AttributeError` in `ExplicitBucketHistogramAggregation` when applied to non-Histogram instruments without explicit boundaries in `opentelemetry-sdk`.
- Mapped Python `CRITICAL` log level to OTel `FATAL` severity text per the specification in `opentelemetry-sdk`.
- Fixed intermittent CI failures in `getting-started` and `tracecontext` jobs by installing contrib packages from the local copy instead of a second git clone.
- Fixed type annotations on `MetricReader` and related types in `opentelemetry-sdk`.
- Implemented log creation metric in `opentelemetry-sdk`.
- Implemented metric reader metrics in `opentelemetry-sdk`.
- Implemented processor metrics in `opentelemetry-sdk`.
- Fixed metric name prefix in `opentelemetry-exporter-prometheus`.
- Used consistent protobuf for export request in `opentelemetry-exporter-otlp-proto-http`.
- Redid OTLPMetricExporter unit tests for `max_export_batch_size` to use real `export`.
Affected Symbols
opentelemetry-sdkdetection_development.detectors[].hostdetection_development.detectors[].containeropentelemetry-resource-detector-containeridcreate_tracer_providerconfigure_tracer_providerExplicitBucketHistogramAggregationBatchLogRecordProcessorschedule_delay_millisOTEL_BLRP_SCHEDULE_DELAYdetection_development.detectors[].process_parse_headerscreate_meter_providerconfigure_meter_providercreate_resourcecreate_propagatorconfigure_propagatorCRITICALFATALMetricReaderSpanReadableSpanBoundedAttributesBoundedListmax_export_batch_sizeTracerConfig