> For the complete documentation index, see [llms.txt](https://docs.layerlens.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layerlens.ai/7.-observe-see-whats-happening/traces.md).

# Traces

{% hint style="info" %}
**Available in Stratix Premium.** This surface is part of the logged-in workspace at [stratix.layerlens.ai](https://stratix.layerlens.ai). Stratix Public users can browse the catalog but cannot use this feature.
{% endhint %}

The Traces surface ingests agent run records and lets you inspect them in detail. URL: [`stratix.layerlens.ai/dashboard/agent-evaluation/traces`](https://stratix.layerlens.ai/dashboard/agent-evaluation/traces).

## What you can do

* Upload a trace JSON file (single trace or batch)
* Stream traces in via the SDK or API
* Browse all traces in your org
* Filter by date, name, tag, status
* Inspect a single trace's full span tree, inputs, outputs, latencies, costs, errors
* Tag and annotate traces

## Trace shape

Minimum:

```json
{
 "id": "trace-123",
 "name": "answer-question",
 "inputs": {"prompt": "What's the capital of France?"},
 "outputs": {"response": "Paris."},
 "spans": [
 {"name": "llm-call", "kind": "llm", "model": "claude-opus-4-7",...},
 {"name": "tool-call", "kind": "tool", "tool": "lookup_country",...}
 ]
}
```

Stratix preserves any additional fields. The trace inspector renders metadata, spans, and any custom fields.

## Inspecting a trace

The trace page shows:

* Inputs and outputs at the top level
* Span tree with timing and cost rolled up per span
* Per-span details (kind, model, inputs, outputs, errors)
* Tags and annotations

## Streaming traces

For continuous evaluation, stream traces via the SDK:

```python
from layerlens import Stratix
client = Stratix()
client.traces.create(id=..., name=..., inputs={...}, outputs={...}, spans=[...])
```

See the [SDK reference](/6.-build-wire-your-code/sdk-python.md) for batch ingestion patterns.

## Datasets and trace sets

Group traces into a **dataset** — a named, versioned collection — to make them the reusable input to a trace evaluation. Create one from any filtered trace list, upload traces from a file, or **generate** synthetic traces when you don't have enough real ones yet.

* [Datasets](/7.-observe-see-whats-happening/datasets.md) — create, version, and evaluate collections of traces
* [Synthetic data](/7.-observe-see-whats-happening/synthetic-data.md) — generate realistic multi-agent trace datasets from scratch

## Where to next

* [Datasets](/7.-observe-see-whats-happening/datasets.md)
* [Synthetic data](/7.-observe-see-whats-happening/synthetic-data.md)
* [Trace evaluations](/8.-evaluate-score-the-outputs/trace-evaluations.md)
* [Concept: Traces and spans](/6.-build-wire-your-code/traces-and-spans.md)
* [Tutorial: Score live traces](/8.-evaluate-score-the-outputs/04-score-traces.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.layerlens.ai/7.-observe-see-whats-happening/traces.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
