Skip to main content
Wrapper around OpenTelemetry span with simplified helper methods. Initialize wrapper around an OTel span or context manager.

Parameters

span_or_context
Any
required
An OTel span or context manager.
media_uploader
Any
default:"None"
Optional MediaUploader for normalizing large base64 content before span export.

enter()

Enter context manager and start span.

Returns

FiddlerSpan

exit()

Exit context manager, record exceptions, and end span.

Returns

Literal[False]

end()

Explicitly end the span. Must be called when using start_span().

set_input()

Set input data. Auto-serializes dicts/lists to JSON.

set_output()

Set output data. Auto-serializes dicts/lists to JSON.

set_attribute()

Set a custom attribute on the span.

update()

Bulk update multiple attributes.

record_exception()

Record an exception on the span.

set_agent_name()

Set the agent name (gen_ai.agent.name).

set_agent_id()

Set the agent ID (gen_ai.agent.id).

set_conversation_id()

Set the conversation ID (gen_ai.conversation.id).
See the canonical reference for the full description and examples.