Change8

Migrating to OpenTelemetry Python v1.42.0

Version v1.42.0 introduces 2 breaking changes. This guide details how to update your code.

Released: 5/19/2026

2
Breaking Changes
2
Migration Steps
8
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

IdGeneratorLoggerLogRecordW3CBaggagePropagatorPrometheusMetricReaderProcessResourceDetectorget_aggregated_resourcesOTEL_PYTHON_SDK_INTERNAL_METRICS_ENABLED

Breaking Changes

Issue #1

Python 3.9 support has been dropped.

Solution

Upgrade your environment to use Python 3.10 or newer.

Issue #2

Third-party importlib-metadata is removed from opentelemetry-api because Python >= 3.10 is now required, relying on the standard library.

Solution

Ensure your environment is Python 3.10+; no code change is typically required unless you were relying on specific importlib-metadata behavior not covered by the standard library.

Migration Steps

  1. 1
    If implementing custom `IdGenerator`, ensure you implement `is_trace_id_random` if you randomly generate the 56 least significant bits of the trace ID.
  2. 2
    If using declarative configuration, note that resource detector loading is now conditional on `OTEL_EXPERIMENTAL_RESOURCE_DETECTORS` being set if entry points are present.

Release Summary

This release significantly enhances declarative configuration support by adding plugin loading for samplers, propagators, and exporters via entry points. It also drops support for Python 3.9 and enforces W3C Baggage size limits on injection.

Need More Details?

View the full release notes and all changes for OpenTelemetry Python v1.42.0.

View Full Changelog