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

# Traces

> View and analyze OpenTelemetry traces from your agents.

View agent traces in the web UI under your agent's **Traces** tab.

<img src="https://mintcdn.com/blink-8fc97cdb/-JnKEx3UGKxJolE7/images/cloud-tracing.png?fit=max&auto=format&n=-JnKEx3UGKxJolE7&q=85&s=cfd9ab7707368a97f6fe1cb0f4e7fbac" alt="Traces" width="2172" height="1440" data-path="images/cloud-tracing.png" />

Traces are collected using the OpenTelemetry (OTLP) protocol from agent containers.

## View Modes

### List View

The default view shows spans in a flat list. Each span displays:

* **Name** - The span operation name
* **Status** - Success, error, or unset
* **Duration** - How long the span took
* **Start time** - When the span started

Click any span to open a sidebar with full details including attributes and events.

### Tree View

Click on a trace ID to see all spans in that trace as a hierarchical tree. This shows the parent-child relationships between spans and visualizes timing with a waterfall chart.

## Filtering

* **Date range** - Select a time range (default: last 24 hours)
* **Filters** - Add filters to match spans by any field. Click the filter button, enter a field name and value, and spans matching all filters will be shown.

For example, to find all spans with errors, add a filter with field `span.status_code` and value `ERROR`.

## Span Details

Click any span to view:

* **Attributes** - Key-value metadata attached to the span
* **Events** - Timestamped events within the span
* **Logs** - Associated log entries (if `trace_id` matches)

## Storage

Traces are stored in PostgreSQL. There is currently no automatic retention policy - traces are stored indefinitely. This is because Blink is in early access and automatic trace retention has not yet been implemented.

To manually delete traces older than 7 days, run the following SQL query against your database:

```sql theme={null}
DELETE FROM agent_trace WHERE start_time < NOW() - INTERVAL '7 days';
```
