Skip to content

Commit a326c27

Browse files
nagkumar91Copilotxrmx
authored
openai-v2: import OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT from genai-utils (#4455)
* 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> * openai-v2: add CHANGELOG entry for #4455 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Apply suggestion from @xrmx --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
1 parent 51b5753 commit a326c27

File tree

2 files changed

+7
-4
lines changed
  • instrumentation-genai/opentelemetry-instrumentation-openai-v2

2 files changed

+7
-4
lines changed

instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- Import `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` from
11+
`opentelemetry.util.genai.environment_variables` instead of re-defining it locally,
12+
making `opentelemetry-util-genai` the single source of truth for this constant.
13+
([#4455](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4455))
1014
- Fix compatibility with wrapt 2.x by using positional arguments in `wrap_function_wrapper()` calls
1115
([#4445](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4445))
1216
- Fix `ChoiceBuffer` crash on streaming tool-call deltas with `arguments=None`

instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
error_attributes as ErrorAttributes,
3737
)
3838
from opentelemetry.trace.status import Status, StatusCode
39+
from opentelemetry.util.genai.environment_variables import (
40+
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT,
41+
)
3942
from opentelemetry.util.genai.types import (
4043
InputMessage,
4144
LLMInvocation, # pylint: disable=no-name-in-module # TODO: migrate to InferenceInvocation
@@ -45,10 +48,6 @@
4548
ToolCallResponse,
4649
)
4750

48-
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT = (
49-
"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT"
50-
)
51-
5251

5352
def is_content_enabled() -> bool:
5453
capture_content = environ.get(

0 commit comments

Comments
 (0)