Background
When a chat completion request is streamed, the handler currently exports the full collected output messages and tool-call arguments to trace span attributes unconditionally via output_collector.output_message_span_properties() (called in both the error path and the normal stream-end path of handle_stream_request in src/proxy/handlers/chat_completions/mod.rs).
Problem
Exporting full model output content (including tool-call arguments and assistant message text) into tracing storage by default may leak sensitive user/model content to trace backends (e.g., Jaeger, OTLP collectors). Not all deployments want or should have this data stored in their observability infrastructure.
Proposed Solution
- Add a configuration flag (e.g.,
observability.trace.export_content or similar) that controls whether message/tool-call content is included in span attributes.
- Gate the
span.add_properties(|| output_collector.output_message_span_properties()) calls behind this flag — disabled by default (opt-in).
- Optionally, provide a redaction/truncation mode (e.g., truncate to N characters) as an alternative to full suppression.
- Apply the same gating to both call sites (stream-error path and stream-end path).
References
/cc @bzp2010
Background
When a chat completion request is streamed, the handler currently exports the full collected output messages and tool-call arguments to trace span attributes unconditionally via
output_collector.output_message_span_properties()(called in both the error path and the normal stream-end path ofhandle_stream_requestinsrc/proxy/handlers/chat_completions/mod.rs).Problem
Exporting full model output content (including tool-call arguments and assistant message text) into tracing storage by default may leak sensitive user/model content to trace backends (e.g., Jaeger, OTLP collectors). Not all deployments want or should have this data stored in their observability infrastructure.
Proposed Solution
observability.trace.export_contentor similar) that controls whether message/tool-call content is included in span attributes.span.add_properties(|| output_collector.output_message_span_properties())calls behind this flag — disabled by default (opt-in).References
/cc @bzp2010