Skip to content

fix: keep opentelemetry-api below 1.46 for fastapi - #806

Open
deanq wants to merge 1 commit into
mainfrom
deanq/pin-opentelemetry-api
Open

deanq wants to merge 1 commit into
mainfrom
deanq/pin-opentelemetry-api

Conversation

@deanq

@deanq deanq commented Dec 5, 2026

Copy link
Copy Markdown
Member

What

Caps opentelemetry-api below 1.46 in requirements.txt.

Why

fastapi.telemetry imports opentelemetry._logs, and opentelemetry-api 1.46 deprecates that module in favor of opentelemetry.logs. The import emits a DeprecationWarning. pytest runs with filterwarnings = error, so any test module that imports fastapi fails at collection time. Right now that breaks tests/test_serialization.py, tests/test_serverless/test_modules/test_fastapi.py and tests/test_serverless/test_prestart.py on main and on every open PR.

The SDK does not import opentelemetry._logs itself. The comment next to the pin says to drop it once fastapi imports opentelemetry.logs.

Tradeoff

requirements.txt is the package's runtime dependency list, so the cap applies to every runpod install, not only CI. Users who need opentelemetry-api 1.46+ alongside runpod will get a resolver conflict until the pin is lifted. The alternative was a pytest-only ignore for this warning, which keeps runtime installs unconstrained but hides the warning in tests.

Test plan

  • Before the pin, the three modules above fail at collection with the opentelemetry._logs DeprecationWarning
  • With the pin (resolves opentelemetry-api 1.45.3), those modules pass (80 tests)
  • make quality-check: 4848 passed, 8 skipped, coverage 95.6%

fastapi.telemetry imports opentelemetry._logs, which opentelemetry-api
1.46 deprecates. With pytest's filterwarnings=error that fails test
collection for every module importing fastapi. Cap opentelemetry-api
until fastapi imports opentelemetry.logs.
Copilot AI balanced review requested due to automatic review settings December 5, 2026 08:11
@deanq deanq self-assigned this Dec 5, 2026
@deanq
deanq requested a review from fser December 5, 2026 08:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

This branch has not been deployed

No deployments
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.

2 participants