Change8

v1.40.0

📦 opentelemetry-pythonView on GitHub →
7 features🐛 7 fixes1 deprecations🔧 7 symbols

Summary

This release introduces experimental features like composable samplers and TracerConfigurator, improves exporter resilience, and deprecates the old logging handler in favor of a dedicated instrumentation package.

Migration Steps

  1. Replace usage of deprecated `LoggingHandler` in `opentelemetry-sdk` with functionality provided by `opentelemetry-instrumentation-logging`.

✨ New Features

  • Added support for loading all resource detectors by setting the environment variable `OTEL_EXPERIMENTAL_RESOURCE_DETECTORS` to `*`.
  • Added experimental support for a composable rule-based sampler.
  • Implemented span start/end metrics.
  • Added environment variable carriers to the API.
  • Implemented experimental `TracerConfigurator`.
  • The SDK configurator in `opentelemetry-sdk` now allows overriding the default processors.
  • Configuration models in `opentelemetry-sdk` are now automatically generated using the OTel config JSON schema.

🐛 Bug Fixes

  • Fixed re-initialization of the gRPC channel on UNAVAILABLE errors in `opentelemetry-exporter-otlp-proto-grpc`.
  • Fixed duplicate HELP/TYPE declarations for Prometheus metrics that had different label sets in `opentelemetry-exporter-prometheus`.
  • Fixed the type hint of the `_metrics_data` property in `opentelemetry-sdk` to correctly allow `None`.
  • Prevented possible endless recursion in `SimpleLogRecordProcessor.on_emit`.
  • Fixed retry logic and error handling for connection failures in trace, metric, and log exporters in `opentelemetry-exporter-otlp-proto-http`.
  • Avoided `RuntimeError` during iteration of the view instrument match dictionary in `MetricReaderStorage.collect()` within `opentelemetry-sdk`.
  • Fixed an instrument creation race condition in `opentelemetry-sdk`.

Affected Symbols

⚡ Deprecations

  • The `LoggingHandler` in `opentelemetry-sdk` is deprecated in favor of using `opentelemetry-instrumentation-logging`. See the documentation for `opentelemetry-instrumentation-logging` for migration details.