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

# get_current_span

> Get the currently active span as a Fiddler wrapper (inside a traced function).

Get the currently active span as a Fiddler wrapper (inside a traced function).

Retrieves the span from the current context and verifies it belongs to Fiddler's tracer
to maintain isolation from other OpenTelemetry tracers.

## Parameters

<ParamField path="as_type" type="Literal['span', 'generation', 'chain', 'tool']" required={false} default="'span'">
  Wrapper type — `"span"`, `"generation"`, `"chain"`, or `"tool"`.
</ParamField>

## Returns

<ResponseField type="FiddlerSpan | FiddlerGeneration | FiddlerChain | FiddlerTool | None">
  Current span wrapper, or None if no active Fiddler span exists.
</ResponseField>
