File tree Expand file tree Collapse file tree 4 files changed +19
-0
lines changed
instrumentation-genai/opentelemetry-instrumentation-openai-agents/examples Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -40,3 +40,10 @@ values exported.
4040
4141You should see the agent response printed to the console while spans export to
4242your 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.
Original file line number Diff line number Diff line change @@ -10,5 +10,8 @@ OTEL_SERVICE_NAME=opentelemetry-python-openai-agents-zero-code
1010# Enable auto-instrumentation for logs if desired
1111OTEL_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
Original file line number Diff line number Diff line change @@ -39,3 +39,9 @@ also works when the required environment variables are already exported.
3939
4040You should see the agent response printed to the console while spans export to
4141your 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.
You can’t perform that action at this time.
0 commit comments