> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiddler.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# FiddlerSpan

> Wrapper around OpenTelemetry span with simplified helper methods.

<Info>Re-exported from [`fiddler_otel.span_wrapper.FiddlerSpan`](/sdk-api/otel/fiddler-span).</Info>

Wrapper around OpenTelemetry span with simplified helper methods.

Initialize wrapper around an OTel span or context manager.

## Parameters

<ParamField path="span_or_context" type="Any" required={true}>
  An OTel span or context manager.
</ParamField>

<ParamField path="media_uploader" type="Any" required={false} default="None">
  Optional `MediaUploader`
  for normalizing large base64 content before span export.
</ParamField>

## **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).

<Info>See the [canonical reference](/sdk-api/otel/fiddler-span) for the full description and examples.</Info>
