Change8

v1.41.0

Breaking Changes
📦 opentelemetryView on GitHub →
2 breaking12 features🐛 10 fixes🔧 26 symbols

Summary

This release introduces extensive support for declarative configuration in `opentelemetry-sdk`, enabling setup via YAML/JSON files for providers, resources, and detectors. It also fixes a critical default configuration change for `BatchLogRecordProcessor` and enhances metric/log processing capabilities.

⚠️ 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

  1. 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`.
  2. If you were relying on the internal mechanism of creating multiple Tracer instances with the same scope, be aware that `opentelemetry-sdk` now caches the Tracer based on instrumentation scope.

✨ 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