You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Message content such as the contents of the prompt, completion, function arguments and return values
82
82
are not captured by default. To capture message content as log events, set the environment variable
83
-
`OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` to `true`.
83
+
``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT`` to one of the following values:
84
84
85
-
TODO!
85
+
- ``true`` - Legacy. Used to enable content capturing on ``gen_ai.{role}.message`` and ``gen_ai.choice`` events when
86
+
`latest experimental features <#enabling-the-latest-experimental-features>`_ are *not* enabled.
87
+
- ``span`` - Used to enable content capturing on *span* attributes when
88
+
`latest experimental features <#enabling-the-latest-experimental-features>`_ are enabled.
89
+
- ``event`` - Used to enable content capturing on *event* attributes when
90
+
`latest experimental features <#enabling-the-latest-experimental-features>`_ are enabled.
91
+
92
+
Enabling the latest experimental features
93
+
***********************************************
94
+
95
+
To enable the latest experimental features, set the environment variable
96
+
``OTEL_SEMCONV_STABILITY_OPT_IN`` to ``gen_ai_latest_experimental``. Or, if you use
97
+
``OTEL_SEMCONV_STABILITY_OPT_IN`` to enable other features, append ``,gen_ai_latest_experimental`` to its value.
98
+
99
+
Without this setting, OpenAI instrumentation aligns with `Semantic Conventions v1.28.0 <https://github.com/open-telemetry/semantic-conventions/tree/v1.28.0/docs/gen-ai>`_
100
+
and would not capture additional details introduced in later versions.
101
+
102
+
.. note:: Generative AI semantic conventions are still evolving. The latest experimental features will introduce breaking changes in future releases.
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`` configures OpenAI instrumentation to capture prompt and completion contents on events.
14
+
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=span`` configures OpenAI instrumentation to capture prompt and completion contents on *span* attributes.
- ``OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true`` configures OpenTelemetry SDK to export logs and events.
16
-
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`` configures OpenAI instrumentation to capture prompt and completion contents on events.
16
+
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=span`` configures OpenAI instrumentation to capture prompt and completion contents on *span* attributes.
17
17
- ``OTEL_LOGS_EXPORTER=otlp`` to specify exporter type.
Copy file name to clipboardExpand all lines: instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/__init__.py
0 commit comments