Skip to content

OpenAI Instrumentation: Switch to Latest GenAI SemConv Path (chat)#108

Open
lzchen wants to merge 1 commit into
open-telemetry:mainfrom
lzchen:genai
Open

OpenAI Instrumentation: Switch to Latest GenAI SemConv Path (chat)#108
lzchen wants to merge 1 commit into
open-telemetry:mainfrom
lzchen:genai

Conversation

@lzchen
Copy link
Copy Markdown
Contributor

@lzchen lzchen commented Jun 2, 2026

Part of #107

Splitting this up into several smaller PRs for easier review.

Copilot AI review requested due to automatic review settings June 2, 2026 18:33
@lzchen lzchen requested a review from a team as a code owner June 2, 2026 18:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR advances the OpenAI GenAI instrumentation migration by removing runtime routing to the legacy semantic-conventions path and rebaselining test configuration toward the latest-only behavior, as part of issue #107’s staged plan.

Changes:

  • Update OpenAI instrumentor to always use the “new” (util/handler-based) chat-completions wrappers and instrument Responses unconditionally when available.
  • Rebaseline OpenAI tests to no longer parametrize legacy semconv mode in content_mode.
  • Add a towncrier changelog fragment describing the latest-semconv-only switch.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
instrumentation/opentelemetry-instrumentation-genai-openai/tests/conftest.py Removes legacy semconv parameterization from the shared content_mode fixture.
instrumentation/opentelemetry-instrumentation-genai-openai/src/opentelemetry/instrumentation/genai/openai/init.py Removes legacy wrapper routing and updates user-facing configuration docs.
instrumentation/opentelemetry-instrumentation-genai-openai/.changelog/PR_NUMBER.changed Adds a changelog fragment (currently with a placeholder filename).

@lzchen lzchen changed the title OpenAI Instrumentation: Switch to Latest GenAI SemConv Path and Rebaseline Tests OpenAI Instrumentation: Switch to Latest GenAI SemConv Path Jun 2, 2026
@lzchen lzchen changed the title OpenAI Instrumentation: Switch to Latest GenAI SemConv Path OpenAI Instrumentation: Switch to Latest GenAI SemConv Path (chat) Jun 3, 2026
and does not capture prompt or completion content. Behavior is controlled
via environment variables:

- ``OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental`` - opt into the
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lmolkova

Did we want to eventually change genai utils to not rely on stability opt in env var to enable content capture?

Comment on lines +72 to +73
# (False, "True") is not tested because the instrumentation always emits
# gen_ai.provider.name (latest semconv) on spans regardless of OTEL_SEMCONV_STABILITY_OPT_IN.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
# (False, "True") is not tested because the instrumentation always emits
# gen_ai.provider.name (latest semconv) on spans regardless of OTEL_SEMCONV_STABILITY_OPT_IN.

will be more confusing than helpful once we clean things up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants