Skip to main content
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

as_type
Literal['span', 'generation', 'chain', 'tool']
default:"'span'"
Wrapper type — "span", "generation", "chain", or "tool".

Returns

Current span wrapper, or None if no active Fiddler span exists.
See the canonical reference for the full description and examples.