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

# On Span End • AI Agent SDK

> on_span_end: Called when a span ends.

# on\_span\_end

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**ObservabilityAdapter**](../classes/ObservabilityAdapter) class in the [**obs**](../modules/obs) module.

Called when a span ends.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def on_span_end(span_id: str, status: str, attributes: Optional[Dict[str, Any]]) -> None
```

## Parameters

<ParamField query="span_id" type="str" required={true}>
  No description available.
</ParamField>

<ParamField query="status" type="str" required={false} default="'ok'">
  No description available.
</ParamField>

<ParamField query="attributes" type="Optional" required={false}>
  No description available.
</ParamField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/obs/__init__.py#L91">
  `praisonaiagents/obs/__init__.py` at line 91
</Card>
