Skip to content

Unpin sqlalchemy<2.1 once the OTel SQLAlchemy instrumentor supports 2.1 #60

Open

Description

@lesnik512

Blocked by: a release of opentelemetry-instrumentation-sqlalchemy that includes open-telemetry/opentelemetry-python-contrib#5120 (merged 2026-10-14, not released yet).

Why the pin exists

pyproject.toml pins sqlalchemy[asyncio]<2.1. Every released opentelemetry-instrumentation-sqlalchemy up to 0.66b1 declares sqlalchemy >= 1.0.0, < 2.1.0. On SQLAlchemy 2.1, instrument() hits a DependencyConflict and does nothing, and lite-bootstrap silences the logger that reports it. With #59 the SQLAlchemy instrumentor is the only source of database spans, so upgrading would quietly drop all DB tracing.

Why it's worth doing

On our benchmark, SQLAlchemy 2.1.4 made ORM session.get about 20-30% faster than 2.0.54. Core queries and bulk inserts didn't change.

When unblocked

  1. Upgrade opentelemetry-instrumentation-sqlalchemy to the release with SQLAlchemy 2.1 support.
  2. Remove the <2.1 pin and run uv lock.
  3. Run the full suite. tests/test_tracing.py fails if the instrumentor stops producing spans.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions