From 7f5c6cd830b5fbc7ff7f5a6ff14134ee43483e86 Mon Sep 17 00:00:00 2001 From: Nagkumar Arkalgud Date: Thu, 16 Apr 2026 15:09:16 -0700 Subject: [PATCH 1/3] openai-v2: import OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT from genai-utils Remove local re-definition of OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT and import it from opentelemetry.util.genai.environment_variables instead, making genai-utils the single source of truth for this constant. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/opentelemetry/instrumentation/openai_v2/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/utils.py b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/utils.py index 6afca130b6..c6fd34d8cd 100644 --- a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/utils.py +++ b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/utils.py @@ -36,6 +36,9 @@ error_attributes as ErrorAttributes, ) from opentelemetry.trace.status import Status, StatusCode +from opentelemetry.util.genai.environment_variables import ( + OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT, +) from opentelemetry.util.genai.types import ( InputMessage, LLMInvocation, @@ -45,10 +48,6 @@ ToolCallResponse, ) -OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT = ( - "OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT" -) - def is_content_enabled() -> bool: capture_content = environ.get( From 97cd1002a03bb8c91b5479d52d3b44c6ecaf4f4c Mon Sep 17 00:00:00 2001 From: Nagkumar Arkalgud Date: Thu, 16 Apr 2026 15:13:32 -0700 Subject: [PATCH 2/3] openai-v2: add CHANGELOG entry for #4455 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../opentelemetry-instrumentation-openai-v2/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md index 76d2deabc4..94aedc37e2 100644 --- a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md +++ b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- Import `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` from + `opentelemetry.util.genai.environment_variables` instead of re-defining it locally, + making `opentelemetry-util-genai` the single source of truth for this constant. + ([#4455](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4455)) + - Fix `ChoiceBuffer` crash on streaming tool-call deltas with `arguments=None` ([#4350](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4350)) - Fix `StreamWrapper` missing `.headers` and other attributes when using `with_raw_response` streaming From 5e2eda8a7cd77aa6f7873498f6c8fc9b1425899c Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 20 Apr 2026 16:13:01 +0200 Subject: [PATCH 3/3] Apply suggestion from @xrmx --- .../opentelemetry-instrumentation-openai-v2/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md index 94aedc37e2..ea37dcd005 100644 --- a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md +++ b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md @@ -11,7 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `opentelemetry.util.genai.environment_variables` instead of re-defining it locally, making `opentelemetry-util-genai` the single source of truth for this constant. ([#4455](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4455)) - - Fix `ChoiceBuffer` crash on streaming tool-call deltas with `arguments=None` ([#4350](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4350)) - Fix `StreamWrapper` missing `.headers` and other attributes when using `with_raw_response` streaming