GenAITracingOptions interface

Options for configuring GenAI tracing on a specific AIProjectClient instance.

Pass these under the tracingOptions key of AIProjectClientOptionalParams to enable GenAI tracing when the client is instantiated. Each client instance maintains its own independent tracing configuration.

Properties

contentRecording

Whether to capture message content in traces. Content includes chat messages, function call names, arguments, and return values. When set to true or false, that value is used directly. When omitted, the OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT environment variable is checked (accepts "true" case-insensitive or "1"). Defaults to false.

experimental

Acknowledge that GenAI tracing features are experimental and may change or be removed in future releases without notice. When set to true, tracing is enabled. When omitted, the AZURE_EXPERIMENTAL_ENABLE_GENAI_TRACING environment variable is checked (accepts "true" case-insensitive or "1"). Defaults to false.

traceContextPropagation

Whether to inject W3C trace context headers (traceparent, tracestate) into outgoing OpenAI requests. When set to true or false, that value is used directly. When omitted, the AZURE_TRACING_GEN_AI_ENABLE_TRACE_CONTEXT_PROPAGATION environment variable is checked (accepts "true" case-insensitive or "1"). Defaults to true.

Property Details

contentRecording

Whether to capture message content in traces. Content includes chat messages, function call names, arguments, and return values. When set to true or false, that value is used directly. When omitted, the OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT environment variable is checked (accepts "true" case-insensitive or "1"). Defaults to false.

contentRecording?: boolean

Property Value

boolean

experimental

Acknowledge that GenAI tracing features are experimental and may change or be removed in future releases without notice. When set to true, tracing is enabled. When omitted, the AZURE_EXPERIMENTAL_ENABLE_GENAI_TRACING environment variable is checked (accepts "true" case-insensitive or "1"). Defaults to false.

experimental?: boolean

Property Value

boolean

traceContextPropagation

Whether to inject W3C trace context headers (traceparent, tracestate) into outgoing OpenAI requests. When set to true or false, that value is used directly. When omitted, the AZURE_TRACING_GEN_AI_ENABLE_TRACE_CONTEXT_PROPAGATION environment variable is checked (accepts "true" case-insensitive or "1"). Defaults to true.

traceContextPropagation?: boolean

Property Value

boolean