From 7f5c6cd830b5fbc7ff7f5a6ff14134ee43483e86 Mon Sep 17 00:00:00 2001 From: Nagkumar Arkalgud Date: Thu, 16 Apr 2026 15:09:16 -0700 Subject: [PATCH] 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(