Skip to content

Commit a588bc8

Browse files
committed
docs(openai-agents): explain message capture environment options
1 parent 072f81e commit a588bc8

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

instrumentation-genai/opentelemetry-instrumentation-openai-agents/examples/manual/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ OTEL_SERVICE_NAME=opentelemetry-python-openai-agents-manual
99

1010
# Optionally override the agent name reported on spans
1111
# OTEL_GENAI_AGENT_NAME=Travel Concierge
12+
13+
# Set to ``no_content`` to opt out of capturing prompts and completions
14+
# OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=no_content

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,10 @@ values exported.
4040

4141
You should see the agent response printed to the console while spans export to
4242
your configured observability backend.
43+
44+
By default the instrumentation records prompts, responses, and tool payloads
45+
in both span attributes and events
46+
(``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=span_and_event``). Set
47+
the variable to ``span_only`` or ``event_only`` to limit capture to a single
48+
signal, or to ``no_content`` to opt out entirely before running the sample.
49+
Boolean strings such as ``true``/``false`` are also accepted.

instrumentation-genai/opentelemetry-instrumentation-openai-agents/examples/zero-code/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ OTEL_SERVICE_NAME=opentelemetry-python-openai-agents-zero-code
1010
# Enable auto-instrumentation for logs if desired
1111
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
1212

13+
# Set to ``no_content`` to opt out of capturing prompts and completions
14+
# OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=no_content
15+
1316
# Optionally override the agent name reported on spans
1417
# OTEL_GENAI_AGENT_NAME=Travel Concierge

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ also works when the required environment variables are already exported.
3939

4040
You should see the agent response printed to the console while spans export to
4141
your observability backend.
42+
43+
Prompts, completions, and tool payloads are captured by default in both span
44+
attributes and events. Set ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT``
45+
to ``span_only`` or ``event_only`` to narrow the capture, or to ``no_content``
46+
to suppress content entirely for this example. Boolean strings such as
47+
``true``/``false`` are also accepted.

0 commit comments

Comments
 (0)