Skip to content

Commit 4d9ba77

Browse files
committed
update schema URL and docs
1 parent 996cda8 commit 4d9ba77

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

instrumentation-genai/opentelemetry-instrumentation-openai-v2/README.rst

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Many LLM platforms support the OpenAI SDK. This means systems such as the follow
1919
* - Name
2020
- gen_ai.system
2121
* - `Azure OpenAI <https://github.com/openai/openai-python?tab=readme-ov-file#microsoft-azure-openai>`_
22-
- ``az.ai.openai``
22+
- ``azure.ai.openai``
2323
* - `Gemini <https://developers.googleblog.com/en/gemini-is-now-accessible-from-the-openai-library/>`_
2424
- ``gemini``
2525
* - `Perplexity <https://docs.perplexity.ai/api-reference/chat-completions>`_
@@ -80,9 +80,26 @@ Enabling message content
8080

8181
Message content such as the contents of the prompt, completion, function arguments and return values
8282
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:
8484

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.
86103

87104
Uninstrument
88105
************

instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/manual/README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ your OpenAI requests.
1111

1212
Note: `.env <.env>`_ file configures additional environment variables:
1313

14-
- ``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.
15+
- ``OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental`` enables latest experimental features.
1516

1617
Setup
1718
-----

instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/zero-code/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ your OpenAI requests.
1313
Note: `.env <.env>`_ file configures additional environment variables:
1414

1515
- ``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.
1717
- ``OTEL_LOGS_EXPORTER=otlp`` to specify exporter type.
18+
- ``OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental`` enables latest experimental features.
1819

19-
TODO!
2020
Setup
2121
-----
2222

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,21 @@ def _instrument(self, **kwargs):
7474
__name__,
7575
"",
7676
tracer_provider,
77-
schema_url=Schemas.V1_28_0.value,
77+
schema_url="https://opentelemetry.io/schemas/1.37.0", # TODO: Schemas.V1_37_0.value,
7878
)
7979
event_logger_provider = kwargs.get("event_logger_provider")
8080
event_logger = get_event_logger(
8181
__name__,
8282
"",
83-
schema_url=Schemas.V1_28_0.value,
83+
schema_url="https://opentelemetry.io/schemas/1.37.0", # TODO: Schemas.V1_37_0.value,
8484
event_logger_provider=event_logger_provider,
8585
)
8686
meter_provider = kwargs.get("meter_provider")
8787
self._meter = get_meter(
8888
__name__,
8989
"",
9090
meter_provider,
91-
schema_url=Schemas.V1_28_0.value,
91+
schema_url="https://opentelemetry.io/schemas/1.37.0", # TODO: Schemas.V1_37_0.value,
9292
)
9393

9494
instruments = Instruments(self._meter)

0 commit comments

Comments
 (0)