feat(deps): relax opentelemetry constraint to >=1.39.0,<2#6552
Open
biztex wants to merge 2 commits into
Open
Conversation
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
longcw
reviewed
Jul 27, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6544
Problem
livekit-agentspinsopentelemetry-api/-sdk/-exporter-otlpto~=1.39.0(the 1.39.x patch series). Any application that depends onlivekit-agentstherefore 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 surfacetelemetry/traces.pydepends on:LogData→ReadWriteLogRecordand the switch to kwargs-styleLogger.emit(). Pinning to the patch series was the defensive response.I verified that surface against every release in the proposed range —
1.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 importtraces.pyuses (opentelemetry.sdk._logs,opentelemetry.exporter.otlp.proto.http._log_exporter,opentelemetry.util._decorator._agnosticcontextmanager,opentelemetry._logs), instantiates aLogRecordProcessorwith theemit/on_emithooks, performs the kwargs-styleLogger.emit()call from_upload_session_report, and importstelemetry.traces+telemetry.otel_metrics. All six versions pass. The full--unitsuite (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,<2for 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 therequires-distspecifiers 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._logssurface 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