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

# export_spans()

> Export spans collected from a SpanBuffer or a list of ReadableSpan

## Overview

```python theme={"system"}
export_spans(spans: SpanBuffer | List[ReadableSpan]) -> bool
```

Exports spans with the configured exporter. Returns `True` on success.

## Example

```python theme={"system"}
from keywordsai_tracing import get_client

client = get_client()
with client.get_span_buffer("trace-xyz") as buffer:
    buffer.create_span("task", {"success": True})
spans = buffer.get_all_spans()
client.export_spans(spans)
```
