Repository navigation
openai-v2: enable opentelemetry-instrumentation-genai-openai for latest experimental conventions - #5261
Open
lmolkova wants to merge 1 commit into
Conversation
Pull request dashboard statusWaiting on reviewers · refreshed 2026-10-29 19:10 UTC Review the latest changes. Status above doesn't look right?
|
lmolkova
force-pushed
the
lmolkova/openai-v2-proxy-genai-openai
branch
from
October 29, 2026 17:23
5730b62 to
5477546
Compare
5 tasks done
lmolkova
force-pushed
the
lmolkova/openai-v2-proxy-genai-openai
branch
from
October 29, 2026 17:28
5477546 to
e6a88c1
Compare
7 tasks done
lmolkova
force-pushed
the
lmolkova/openai-v2-proxy-genai-openai
branch
from
October 29, 2026 17:34
e6a88c1 to
41f44e9
Compare
lmolkova
force-pushed
the
lmolkova/openai-v2-proxy-genai-openai
branch
from
October 29, 2026 17:42
41f44e9 to
4b513e0
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The required genai-openai dependency introduces incompatible util-genai constraints with current OpenAI Agents and Vertex AI instrumentations, blocking co-installation and upgrades even when the experimental flag is off.
2 open issues
What changed in this PR
Following #5260, this PR restores experimental-convention support for openai-v2 users by delegating to opentelemetry-instrumentation-genai-openai, while preserving legacy instrumentation when the opt-in flag is unset.
Changes:
- Adds delegation and coexistence handling to avoid double instrumentation.
- Adds the replacement dependency, raises minimum OpenTelemetry versions, and excludes openai-v2 from the uv workspace.
- Updates documentation and tests for delegation, instrumentation lifecycle, and emitted telemetry.
| File | Description |
|---|---|
uv.lock |
Removes openai-v2 workspace entries. |
pyproject.toml |
Excludes openai-v2 from the workspace. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_utils.py |
Adds wrapper and instrumentation-scope helpers. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_responses.py |
Uses the local experimental-mode check. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_response_extractors.py |
Adds targeted pylint suppressions. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_latest_experimental.py |
Tests delegation, lifecycle, and telemetry. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_genai_openai_coexistence.py |
Tests coexistence and loading order. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_embeddings.py |
Uses the local experimental-mode check. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_chat_metrics.py |
Uses the local experimental-mode check. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_chat_completions.py |
Uses the local experimental-mode check. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_async_embeddings.py |
Uses the local experimental-mode check. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_async_chat_completions.py |
Uses the local experimental-mode check. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/requirements.oldest.txt |
Updates minimum test dependencies. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/requirements.latest.txt |
Tests against the replacement package. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/conftest.py |
Adds instrumentor cleanup fixtures. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/__init__.py |
Implements delegation and legacy-mode blocking. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/README.rst |
Documents delegation, content capture, and uploads. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/pyproject.toml |
Adds genai-openai and raises dependency minimums. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/.changelog/5261.changed |
Records minimum-version increases. |
instrumentation-genai/opentelemetry-instrumentation-openai-v2/.changelog/5261.added |
Records delegation and coexistence behavior. |
Review effort: Balanced
lmolkova
force-pushed
the
lmolkova/openai-v2-proxy-genai-openai
branch
from
October 29, 2026 18:00
4b513e0 to
7ea481d
Compare
With gen_ai_latest_experimental, enable opentelemetry-instrumentation-genai-openai (now a dependency) instead of doing nothing. Without the flag, keep it disabled: both packages register the 'openai' entry point, so auto-instrumentation would otherwise instrument OpenAI twice. genai-openai brings opentelemetry-util-genai 1.x, which conflicts with the in-repo util-genai, so the package is excluded from the uv workspace and tested via tox only.
lmolkova
force-pushed
the
lmolkova/openai-v2-proxy-genai-openai
branch
from
October 29, 2026 18:59
7ea481d to
16c1798
Compare
lmolkova
marked this pull request as ready for review
October 29, 2026 19:07
This branch has not been deployed
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.


Makes
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimentaluseful again for existingopentelemetry-instrumentation-openai-v2users: instead of being a no-op, it enablesopentelemetry-instrumentation-genai-openai, so users who keep upgrading this package get the new instrumentation automatically.opentelemetry-instrumentation-genai-openai ~= 1.3.0b0and raises minimum OTel versions to what it requires.instrument()enables genai-openai and forwards all arguments (e.g.completion_hook).openaientry point and auto-instrumentation loads them in no particular order, so without this OpenAI calls would be instrumented twice.opentelemetry-util-genai1.x, which conflicts with the in-repoutil/opentelemetry-util-genai. It's tested via tox with PyPI dependencies.Type of change
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
tox -e precommittox -e typecheck