adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

Update opentelemetry-api and opentelemetry-sdk to < 2 (Updated)

Open BrownMunda1 opened this issue 1 month ago • 11 comments

Wanted to propose an update in the core OTel libraries in the dependencies section of pyproject.toml

opentelemetry-api<=1.42.1 —> opentelemetry-api<2 (https://github.com/google/adk-python/blob/666c26db0bad86ae1b0a0557bc0fd1eeeca0d70e/pyproject.toml#L43)

opentelemetry-sdk<=1.42.1 —> opentelemetry-sdk<2 (https://github.com/google/adk-python/blob/666c26db0bad86ae1b0a0557bc0fd1eeeca0d70e/pyproject.toml#L44)

If not possible, would love to know why are the version bumps not possible, where is the exact point which would break if the OTel versions are updated

Thanks

BrownMunda1 avatar Oct 07 '26 09:10 BrownMunda1

I’m interested in investigating this compatibility update, if nobody has already started. Current main still caps opentelemetry-api and opentelemetry-sdk at 1.42.1. I would first check dependency resolution with the telemetry extras/exporters and run the relevant telemetry tests against 1.44.0. If compatible, I would propose the smallest constraint update with validation evidence; if there is a real blocker, I would document it here rather than blindly raise the bounds.

I found no public claim or matching PR for this issue. If the author or another contributor already has work underway, please let me know so I can avoid duplication. Maintainers: is investigating this bump welcome, or are these upper bounds intentional?

I plan to use Codex assistance. This is an interest/coordination request; I’m prioritizing one contribution at a time rather than promising simultaneous delivery.

reddynitish avatar Oct 07 '26 14:10 reddynitish

I am starting the compatibility investigation now, using Codex assistance. I will reproduce the current install restriction with OpenTelemetry 1.44.0, check dependency resolution for the telemetry extras, and run the telemetry tests against the proposed bounds. If those checks pass, I will submit a minimal dependency update with the validation results. I checked the issue timeline and open PRs again and found no public competing implementation; please let me know if work is already underway privately.

reddynitish avatar Oct 08 '26 13:10 reddynitish

Hello @BrownMunda1,

Thank you for raising this. Could you provide some context regarding this request? Specifically are you encountering a dependency conflict with another package that requires a newer OpenTelemetry version or is there a particular feature or fix in version 1.44.0 that you require? If you are facing a conflict please share the package name and the associated error message.

llalitkumarrr avatar Oct 09 '26 04:10 llalitkumarrr

@llalitkumarrr we're aiming to make use of splunk-opentelemetry for tracing. splunk-opentelemetry's version 2.12.1 is dependent on OTel 1.44.0. We just want to be able to make use of that latest version along with google-adk's latest version. If there is something for which google-adk has a hard dependency on OTel <=1.42.1, would love to know that

BrownMunda1 avatar Oct 09 '26 09:10 BrownMunda1

@llalitkumarrr @jawoszek Please have a look at the PR shared by @krisztianfekete, can we do it in a similar way for google-adk as well? Seems to be not breaking/blocking anything as per the PR raised by @reddynitish

Idea is to not be limited to 1.42.1

BrownMunda1 avatar Oct 18 '26 15:10 BrownMunda1

Actually can we go up to 1.45.1, this is holding back langfuse for me on v4 python SDK.

rcleveng avatar Oct 25 '26 00:10 rcleveng

Notification: The author has updated the issue description. Maintainers, please review.

adk-bot avatar Oct 27 '26 06:10 adk-bot

Actually can we go up to 1.45.1, this is holding back langfuse for me on v4 python SDK.

Second this. Version 1.45.1 is currently the only version available that is not affected by CVE-2026-114603.

ljfraney avatar Oct 27 '26 20:10 ljfraney

9. Hello @BrownMunda1, Thank you for raising this. Could you provide some context regarding this request? Specifically are you encountering a dependency conflict with another package that requires a newer OpenTelemetry version or is there a particular feature or fix in version 1.44.0 that you require? If you are facing a conflict please share the package name and the associated error message.

This creates a dependency conflict with FastAPI:

  1. google-adk==2.13.0 places a strict upper bound on OpenTelemetry: opentelemetry-api ≤ 1.42.1 and opentelemetry-sdk ≤ 1.42.1 2. fastapi[standard]==0.162.0 (starting in FastAPI ≥ 0.142.0) adds built-in telemetry requiring: opentelemetry-exporter-otlp-proto-http ≥ 1.44.0 and opentelemetry-api ≥ 1.44.0 3. Because google-adk caps OpenTelemetry at 1.42.1 and fastapi[standard] requires at least 1.44.0, they cannot coexist.

osttra-dag-lovenvald avatar Oct 30 '26 14:10 osttra-dag-lovenvald

Have created a PR which addresses the issues above by bumping up to the latest otel versions available: #7756 @llalitkumarrr Please have a look!

BrownMunda1 avatar Oct 31 '26 14:10 BrownMunda1

Fixed in 73ae69e: opentelemetry-api and opentelemetry-sdk now allow up to 1.45.2, which includes the CVE-2026-114603 fix (1.45.1) and the traceparent length limit (1.45.2). It will ship in the next release.

On why not <2: ADK uses OpenTelemetry's logs API (opentelemetry._logs / opentelemetry.sdk._logs), which is not covered by OTel's stability guarantees and has broken us in minor releases (1.44 made LogRecordExporter.force_flush abstract; 1.45 requires Logger.enabled). So we keep the ceiling at the latest release we have tested and raise it as new releases come out.

Thanks @BrownMunda1, @rcleveng, @ljfraney and @osttra-dag-lovenvald for the details on the conflicts with splunk-opentelemetry, langfuse and FastAPI.

wuliang229 avatar Nov 02 '26 22:11 wuliang229