Skip to content

feat(deps): relax opentelemetry constraint to >=1.39.0,<2#6552

Open
biztex wants to merge 2 commits into
livekit:mainfrom
biztex:feat/relax-otel-constraint
Open

feat(deps): relax opentelemetry constraint to >=1.39.0,<2#6552
biztex wants to merge 2 commits into
livekit:mainfrom
biztex:feat/relax-otel-constraint

Conversation

@biztex

@biztex biztex commented Jul 27, 2026

Copy link
Copy Markdown

Fixes #6544

Problem

livekit-agents pins opentelemetry-api/-sdk/-exporter-otlp to ~=1.39.0 (the 1.39.x patch series). Any application that depends on livekit-agents therefore cannot install opentelemetry 1.40–1.44, which conflicts with instrumentation packages and other libraries that track current OTel releases.

Why the pin exists — and why it can be relaxed now

The pin was introduced in #4162 (previously >=1.34) when OTel 1.39 changed the private logs-SDK surface telemetry/traces.py depends on: LogDataReadWriteLogRecord and the switch to kwargs-style Logger.emit(). Pinning to the patch series was the defensive response.

I verified that surface against every release in the proposed range1.39.1, 1.40.0, 1.41.1, 1.42.1, 1.43.0, 1.44.0 (latest) — with a smoke test that exercises each private import traces.py uses (opentelemetry.sdk._logs, opentelemetry.exporter.otlp.proto.http._log_exporter, opentelemetry.util._decorator._agnosticcontextmanager, opentelemetry._logs), instantiates a LogRecordProcessor with the emit/on_emit hooks, performs the kwargs-style Logger.emit() call from _upload_session_report, and imports telemetry.traces + telemetry.otel_metrics. All six versions pass. The full --unit suite (1274 tests) also passes with opentelemetry 1.44.0 installed, and again on the locked 1.39.1.

Change

  • ~=1.39.0>=1.39.0,<2 for the three opentelemetry packages, matching the constraint style used elsewhere in this file (livekit-api>=1.2.0,<2, pydantic>=2.0,<3).
  • uv.lock: only the requires-dist specifiers change — the locked versions remain 1.39.x, so the dev environment and CI resolve exactly as before. The range only widens what downstream applications may install.

If a future OTel minor breaks the private sdk._logs surface again, renovate (weekly, 2-week release age) plus CI will surface it; happy to tighten the bound to a tested window (e.g. <1.45) instead if you prefer that tradeoff.

🤖 Generated with Claude Code

The ~=1.39.0 patch-series pin was introduced in livekit#4162 when OTel 1.39 changed
the private logs-SDK surface the telemetry module depends on (LogData ->
ReadWriteLogRecord, kwargs-style Logger.emit). It also prevents applications
that depend on livekit-agents from using any newer opentelemetry (1.40-1.44),
which conflicts with instrumentation packages that track current releases.

Verified against every release in the new range (1.39.1, 1.40.0, 1.41.1,
1.42.1, 1.43.0, 1.44.0): all private imports used by telemetry/traces.py
(opentelemetry.sdk._logs, exporter _log_exporter, util._decorator), the
LogRecordProcessor emit/on_emit hooks and the kwargs-style Logger.emit call
are unchanged, and the full unit suite passes on 1.44.0.

uv.lock still resolves to 1.39.x, so the dev environment and CI are
unaffected; the range only widens what downstream applications may install.

Fixes livekit#6544
@biztex
biztex requested a review from a team as a code owner July 27, 2026 01:13

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Comment thread livekit-agents/pyproject.toml Outdated
Per review: bound the range at the newest release the private logs-SDK
surface has been verified against (1.44.0) instead of <2, so an untested
future minor cannot break telemetry at runtime for downstream apps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

relax opentelemetry version

2 participants