Skip to content

Commit 996cda8

Browse files
committed
implement details event and add tests
1 parent 1b725b4 commit 996cda8

File tree

11 files changed

+1081
-751
lines changed

11 files changed

+1081
-751
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ Message content such as the contents of the prompt, completion, function argumen
8282
are not captured by default. To capture message content as log events, set the environment variable
8383
`OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` to `true`.
8484

85+
TODO!
86+
8587
Uninstrument
8688
************
8789

instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/manual/.env

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,19 @@ OPENAI_API_KEY=sk-YOUR_API_KEY
1212

1313
OTEL_SERVICE_NAME=opentelemetry-python-openai
1414

15-
# Change to 'false' to hide prompt and completion content
16-
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true
15+
# Remove or change to 'none' to hide prompt and completion content
16+
# Possible values (case insensitive):
17+
# - `span` - record content on span attibutes
18+
# - `event` - record content on event attributes
19+
# - `true` - only used for backward compatibility when
20+
# `gen_ai_latest_experimental` is not set in the
21+
# `OTEL_SEMCONV_STABILITY_OPT_IN` environemnt variable.
22+
# - everything else - don't record content on any signal
23+
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=span
24+
25+
# Enables latest and greatest features available in GenAI semantic conventions.
26+
# Note: since conventions are still in development, using this flag would
27+
# likely result in having breaking changes.
28+
#
29+
# Comment out if you want to use semantic conventions of version 1.36.0.
30+
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental

instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/zero-code/.env

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,19 @@ OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
1818
# Uncomment if your OTLP endpoint doesn't support logs
1919
# OTEL_LOGS_EXPORTER=console
2020

21-
# Change to 'false' to hide prompt and completion content
22-
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true
21+
# Remove or change to 'none' to hide prompt and completion content
22+
# Possible values (case insensitive):
23+
# - `span` - record content on span attibutes
24+
# - `event` - record content on event attributes
25+
# - `true` - only used for backward compatibility when
26+
# `gen_ai_latest_experimental` is not set in the
27+
# `OTEL_SEMCONV_STABILITY_OPT_IN` environemnt variable.
28+
# - everything else - don't record content on any signal
29+
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=span
30+
31+
# Enables latest and greatest features available in GenAI semantic conventions.
32+
# Note: since conventions are still in development, using this flag would
33+
# likely result in having breaking changes.
34+
#
35+
# Comment out if you want to use semantic conventions of version 1.36.0.
36+
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Note: `.env <.env>`_ file configures additional environment variables:
1616
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`` configures OpenAI instrumentation to capture prompt and completion contents on events.
1717
- ``OTEL_LOGS_EXPORTER=otlp`` to specify exporter type.
1818

19+
TODO!
1920
Setup
2021
-----
2122

0 commit comments

Comments
 (0)