Skip to content

Drop Python 3.9 support#5076

Merged
xrmx merged 20 commits into
open-telemetry:mainfrom
emdneto:py39-drop
Apr 13, 2026
Merged

Drop Python 3.9 support#5076
xrmx merged 20 commits into
open-telemetry:mainfrom
emdneto:py39-drop

Conversation

@emdneto

@emdneto emdneto commented Apr 10, 2026

Copy link
Copy Markdown
Member

Close #4887

emdneto added 3 commits April 9, 2026 21:55
Signed-off-by: emdneto <[email protected]>
@emdneto
emdneto requested a review from a team as a code owner April 10, 2026 01:00
@DylanRussell

Copy link
Copy Markdown
Contributor

Looks like a bunch of checks are failing but otherwise this LGTM.. is there any official python lang document that describes what you can get rid of now that this version is deprecated ?

@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Apr 10, 2026
@emdneto emdneto moved this from Approved PRs to Approved PRs that need fixes in Python PR digest Apr 10, 2026
@emdneto

emdneto commented Apr 10, 2026

Copy link
Copy Markdown
Member Author

Looks like a bunch of checks are failing but otherwise this LGTM.. is there any official python lang document that describes what you can get rid of now that this version is deprecated ?

@DylanRussell On top of my head, I remember mostly typing stuff like:

  • int | str instead of Union[int, str]
  • str | None instead of Optional[str]
  • TypeAlias

For documentation, I believe: https://docs.python.org/3/whatsnew/3.10.html
We should leverage ruff UP rules to keep the codebase updated with the most recent syntax.

re failing tests: i need to update in -contrib and merge there first

Comment thread opentelemetry-sdk/test-requirements.txt

@MikeGoldsmith MikeGoldsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love to see this.

Thanks for updating the declarative config models and switching on union operators ❤️

Comment thread README.md Outdated
Comment thread opentelemetry-sdk/benchmarks/trace/test_benchmark_trace.py Outdated
@github-project-automation github-project-automation Bot moved this from Approved PRs that need fixes to Approved PRs in Python PR digest Apr 13, 2026
@xrmx
xrmx enabled auto-merge (squash) April 13, 2026 15:30
@xrmx
xrmx merged commit db59842 into open-telemetry:main Apr 13, 2026
465 of 466 checks passed
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Python PR digest Apr 13, 2026
MikeGoldsmith added a commit to MikeGoldsmith/opentelemetry-python that referenced this pull request Apr 14, 2026
…d of core repo

Assisted-by: Claude Sonnet 4.6
xrmx added a commit that referenced this pull request Apr 14, 2026
…#5092)

Assisted-by: Claude Sonnet 4.6

Co-authored-by: Riccardo Magliocchetti <[email protected]>
chimchim89 pushed a commit to chimchim89/opentelemetry-python that referenced this pull request Apr 15, 2026
* Drop python 3.9 support

Signed-off-by: emdneto <[email protected]>

* fix

Signed-off-by: emdneto <[email protected]>

* fix exporter requirements.txt

Signed-off-by: emdneto <[email protected]>

* do not skip  in pypy+windows

Signed-off-by: emdneto <[email protected]>

* pin requirements

Signed-off-by: emdneto <[email protected]>

* pin based on py version

Signed-off-by: emdneto <[email protected]>

* revert argument name

* fix broken links in README.md

Signed-off-by: emdneto <[email protected]>

* fix sdk configuration models

Signed-off-by: emdneto <[email protected]>

* fix codegen and opentelemetry-proto-json

Signed-off-by: emdneto <[email protected]>

* add changelo

Signed-off-by: emdneto <[email protected]>

* remove helper script to fix typealias for datamodel-codegen

Signed-off-by: emdneto <[email protected]>

* revert proto-json version

Signed-off-by: emdneto <[email protected]>

* Apply suggestion from @emdneto

* Apply suggestion from @xrmx

---------

Signed-off-by: emdneto <[email protected]>
Co-authored-by: Riccardo Magliocchetti <[email protected]>
@dhirschfeld dhirschfeld mentioned this pull request May 8, 2026
6 tasks
liustve added a commit to aws-observability/aws-otel-python-instrumentation that referenced this pull request Jun 17, 2026
Automated update of OpenTelemetry dependencies.

**Build Status:** ❌
[failure](https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/27184408784)

**Updated versions:**
- [OpenTelemetry
Python](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.42.1):
1.42.1
- [OpenTelemetry
Contrib](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.63b1):
0.63b1
-
[opentelemetry-sdk-extension-aws](https://pypi.org/project/opentelemetry-sdk-extension-aws/2.1.0/):
2.1.0
-
[opentelemetry-propagator-aws-xray](https://pypi.org/project/opentelemetry-propagator-aws-xray/1.0.2/):
1.0.2

**Upstream releases with breaking changes:**
Note: the mechanism to detect upstream breaking changes is not perfect.
Be sure to check all new releases and understand if any additional
changes need to be addressed.


**opentelemetry-python-contrib:**
- [Version
1.41.0/0.62b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.62b0)

*Description of changes:*

- Drops the `opentelemetry-instrumentation-boto` runtime dependency
(legacy boto2 instrumentation), removed entirely upstream in:
open-telemetry/opentelemetry-python-contrib#4303

- Drops Python 3.9 support to match upstream's new minimum (Python
≥3.10): open-telemetry/opentelemetry-python#5076
(core) and
open-telemetry/opentelemetry-python-contrib#4412
(contrib)

- Switches `from importlib_metadata import version` to stdlib `from
importlib.metadata import version` after upstream dropped the
third-party `importlib-metadata` package from `opentelemetry-api`:
open-telemetry/opentelemetry-python#3234

- Refactors the botocore patches (`_botocore_patches.py`) to use the new
`ExtensionRegistry` API. Upstream split `_KNOWN_EXTENSIONS` into
`_BOTOCORE_EXTENSIONS` + `_AIOBOTOCORE_EXTENSIONS`, removed
`_find_extension`, and moved `_safe_invoke` to
`opentelemetry.instrumentation.botocore.utils` as part of adding
aiobotocore instrumentation:
open-telemetry/opentelemetry-python-contrib#4049

- Removes the Starlette ASGI `suppress_http_instrumentation` patch
(which the existing ADOT TODO already flagged) since the ASGI middleware
now natively honors `suppress_http_instrumentation` upstream:
open-telemetry/opentelemetry-python-contrib#4375

- Adapts the configurator tests to upstream's renamed
`BaggageSpanProcessor._baggage_key_predicate` → `_predicates` (now a
list of callables, after the constructor was reworked to accept either a
single predicate or a sequence):
open-telemetry/opentelemetry-python-contrib#4371

- Adapts `test_otlp_attribute_vs_body_types` to upstream's
`_VALID_ANY_VALUE_TYPES` switching `typing.Mapping`/`typing.Sequence` to
`collections.abc.Mapping`/`collections.abc.Sequence`:
open-telemetry/opentelemetry-python#5133

- Bumps the mysqlclient contract-test pin from `2.2.4` to `2.2.8` and
updates the matching `db.name` assertion. The 0.62b0 dbapi
semantic-convention migration
(open-telemetry/opentelemetry-python-contrib#4109)
added an empty-string filter inside `_set_db_name`, which exposed a
latent gap: mysqlclient < 2.2.7 didn't expose a Python-level `conn.db`
attribute (added upstream in
PyMySQL/mysqlclient#752, shipped in mysqlclient
2.2.7), so OTel's dbapi instrumentation defaulted `database` to `""` and
the empty value used to land on the span unconditionally. After 0.62b0
the empty value is dropped, so the assertion `db.name == ""` now fails
with "key not found". Bumping mysqlclient lets `conn.db` flow through as
the actual database name (`testdb`) so the assertion becomes meaningful.


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Steve Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

It's time to drop Python 3.9

4 participants