# Trace explorer

**Last updated:** 2026-11-26T08:30:56-03:00 (UTC-3)

The **Traces** screen answers two questions about the traffic the gateway serves: *which* requests behaved a certain way, and *what happened inside* one of them. It lists the traces and spans the [span store](/docs/features/traces/) keeps, over one query bar, and opens any of them as a tree, a time-ruled waterfall and an agent graph, with the evaluation results, the feedback, the gateway's own records and the captured content of each step next to it.

Two more scopes, **Sessions** and **Users**, group the same traces by conversation and by end user: see [sessions and end users](/docs/features/sessions-and-users/).

It reads what the gateway already stores. It adds no table, no exporter and no ID of its own: a trace here is the same `trace_id` your tracing backend receives over OTLP, a request is the same `request_id` the request log shows, and a result is the same [evaluation result](/docs/features/evaluation-results/).

## Turn it on

```yaml
features:
  usage_analytics: true
  span_store: true
  trace_explorer: true
```

| Flag | Default | What it turns on |
| --- | --- | --- |
| `request_replay` | `false` | [Replay](#replay-a-request): an operator sends a captured request again as a new request of their own. Requires `content_capture`, `span_store` and `evaluation_tracing`. A tenant action: with `feature_plan_entitlements` the plan of the request's team decides. It resends captured content and it spends, so it is a flag of its own: a team can have the explorer without it. Changeable at runtime from **Settings → Features** or `PUT /api/v1/admin/features/request_replay` |
| `trace_explorer` | `false` | The Traces screen, the trace detail with its three views and five tabs, and the routes below. Requires `span_store`. A tenant read: with `feature_plan_entitlements` a team's plan decides whether its readers have it. Changeable at runtime from **Settings → Features** or `PUT /api/v1/admin/features/trace_explorer` |

Do it in this order:

1. Turn on `span_store` first and let it collect for a while (see [Traces and the span store](/docs/features/traces/)); the explorer lists nothing that was served before spans were stored.
2. Turn on `trace_explorer`. The **Traces** entry appears under **Observability** for every role with `logs:read`.
3. Optional, each with its own flag: [`evaluation_results`](/docs/features/evaluation-results/) for the evaluation badge, lenses and facets; [`evaluation_tracing`](/docs/features/evaluation-tracing/) for judge traces linked both ways; [`content_capture`](/docs/features/content-capture/) for input and output in the detail, and `content_capture_media` for images and audio.

With the flag off the routes answer `404 feature_disabled`, the menu entry is hidden, and a trace still opens in the earlier, simpler trace drawer of the span store. With `request_replay` off the **Replay** action is hidden and its route answers `404 feature_disabled`.

### Who reads what

| Reader | What they see |
| --- | --- |
| A gateway-wide role with `logs:read` (administrator, viewer, operator) | Every team's traces and spans |
| A team role (team administrator, team viewer, user) | Only the traces and spans of their teams. An organization admin is a team administrator of every team of the organization, and never leaves it |
| Any reader | Cost only with `usage_valuation` and `analytics:read`; sessions with `session_tracking`; end users with `end_user_tracking`; tags with `usage_tags`; evaluation results with `evaluation_results` and `evals:read` |

The team filter runs in the query, before any count, facet or page. A trace that crosses teams (a caller's W3C trace used by two teams) is one row per team, each with only that team's spans and figures. Naming another team's trace, request or team in the query finds nothing, and its records answer `404` like a trace that does not exist. A field a reader may not see on a row cannot be used as a filter either, so a filter never answers what a column would not.

## The list

The screen has a **scope** switch, a **lens** strip, a time range, the query bar, a facet rail and the list.

- **Traces** (the default) lists one row per trace: time, the root span's name, status, duration, cost (marked **partial** when some provider attempt has no known price), tokens, models, span and call counts, session, and a badge of its evaluation results. **Spans** lists every span, so a provider attempt, a guardrail or a tool call can be found on its own. Switching keeps the query.
- **Lenses** change what the list is about. **Overview** is the list above. **Evaluations** puts a card per evaluator over the list (pass rate, a pass and fail bar, counts) and one column per evaluator. **Feedback** does the same for end-user feedback and human labels.
- **Time range**: the past 15 minutes to 30 days, or a custom range of at most 92 days. Time is never part of the query. The list can refresh itself every 10, 30 or 60 seconds.
- **Pages**: the list loads 50 rows and **Load more** fetches the next page with a cursor, so a row is never repeated or skipped while new traffic arrives. The total above the list is exact and comes from the facets read.
- **Chart** shows the count over time for the current query, errors in their own colour.
- **Internal calls** is off by default: the gateway's own calls, its LLM judges (`origin:evaluation`) and its helper calls (topic and comparison summaries, prompt suggestions; `origin:helper`), stay out of the list, the facets, the chart and the exports, so the list shows what the applications did. Tick it to list them too (the address keeps `internal=1`). A query that names `origin` (for example `origin:evaluation` to see only the judges) decides on its own and the box is disabled. The setting is a separate filter, `internal=false` on `GET /api/v1/admin/traces`, `/traces/facets` and `/traces/chart`, ANDed with your query: the query is parsed, bounded and saved exactly as you wrote it, never rewritten. A saved view keeps the box. **Create alert rule** and **Automate this query** take your query as written; add `-origin:evaluation -origin:helper` there when the rule should leave the gateway's calls out. An empty list says when internal calls are hidden.
- **Content** (offered to readers with `content_sent:read`) shows the first input and the answer of each listed request. It is off by default: every preview is an audited read of a captured record, so the page is limited to 50 rows and auto-refresh is suspended while it is on.
- **Columns** chooses the columns, listed by group (core, cost and tokens, gateway facts, identity, evaluations), and **Compact** the row height; both are remembered in the browser. *Gateway facts* shows on each trace whether it fell back, hit a cache or had a guardrail flag.
- Selecting rows opens a bar with **Add to dataset** (from the requests' captured content), **Add to review queue** (both need `evals:manage`) and **Export**. **Export CSV**, **Export JSON** and **Export JSONL** (one object per line) export the selection or, with none, every row of the query: the pages not yet listed are read first, up to 5,000 rows, and a notice says when the query has more.
- A row opens the trace detail as a drawer; `j` and `k` move through the list. On a session's page, `j` and `k` open the next and previous session of the list.

Below 720 px the facets move behind **Filters (n)**, a sheet that closes on **Apply**, and rows become cards with time, status, name, model, duration, cost and the evaluation badge.

### The query

Terms are joined by AND; the word `AND` is optional. That is the whole query while `trace_query` is off. With [`trace_query`](/docs/features/query-language/) on, the bar reads the gateway's whole query language: `OR`, `NOT`, parentheses, value lists, ranges, the gateway's own facts on any span of a trace (`canary.side:canary`, `customer.org:acme`, `child.span.kind:tool child.span.status:error`), text search over captured content for content readers, a facet of any field, and saved views. [Query language and saved views](/docs/features/query-language/) is its reference; the table below is the part that works either way.

| Form | Meaning |
| --- | --- |
| `field:value` | Equal. Quote a value with spaces: `name:"POST /v1/chat/completions"` |
| `field:prefix*` | Starts with (text fields; a trailing `*` only) |
| `field:*` | Has a value |
| `-field:value` | Not |
| `field>n`, `field>=n`, `field<n`, `field<=n` | Numbers, durations (`250ms`, `2s`, `1m`; a bare number is milliseconds) and cost in US dollars |

Limits: 4,096 bytes, 64 terms, 256 bytes per value. An unknown field, a value of the wrong type or a field you may not read is a `400 invalid_query` whose message lists the fields you can use. `GET /api/v1/admin/traces/fields` returns the same list with a line of help per field; the **?** button beside the bar shows it.

| Field | Scopes | Values |
| --- | --- | --- |
| `status` | both | `ok`, `error` (a trace is an error when any of its spans is), `unset` |
| `origin` | both | `app`, `evaluation`, `experiment`, `playground`, `helper`, `shadow`, `replay` |
| `model` | both | A model alias the trace used, or the span's model |
| `team` | both | Team ID |
| `fell_back` | both | `true`, `false` |
| `cache` | both | `hit`, `none` |
| `guardrail.flagged` | both | `true`, `false` |
| `session`, `end_user` | both | Text; need `session_tracking` and `end_user_tracking` |
| `trace_id`, `request_id`, `name` | both | Text. For a trace, `request_id` and `name` are its root request's |
| `duration` | both | Duration |
| `cost` | both | US dollars; needs the cost to be visible to you |
| `tokens.input`, `tokens.output` | both | Number |
| `trace.spans`, `trace.llm_calls`, `trace.tool_calls`, `trace.errors` | traces | Number |
| `trace.tokens` | traces | Number: input plus output tokens of the whole trace |
| `span.kind` | spans | `request`, `routing`, `provider_attempt`, `cache`, `guardrail`, `tool`, `judge`, `helper`, `app` |
| `agent` | spans | The agent of the request (on request spans): the one the client declared with `X-Gateway-Agent-Id`, or, with [`agent_recognition`](/docs/features/agent-recognition/), the recognized coding agent (`agent:claude-code`) |
| `span.subkind` values of an agent run | spans | With [`agent_recognition`](/docs/features/agent-recognition/): `client_tool` on a `tool` span is a tool the coding agent ran itself and reported in its next request (name and call ID only, no duration). Its span is named `client tool`, and a transcript's tool span `transcript tool`: the tool's name is in the span's attributes, which the trace view shows only with `content_structure:read` of the team and which lists never carry; `transcript_turn`, `transcript_call`, `transcript_tool` and `transcript_compaction` on `app` spans are steps a [transcript upload](/docs/features/agent-recognition/#transcript-ingest) named |
| `span.subkind`, `span_id`, `provider`, `provider_model`, `error_code`, `key`, `principal`, `customer.org`, `customer.team`, `customer.member` | spans | Text |
| `span.attempt`, `http_status` | spans | Number |
| `tag.<name>` | spans | A request tag; needs `usage_tags` |
| `evaluation.<name>.assessment` | both | `pass`, `fail`, `none`: the traces with such a result of that evaluator or label. `evaluation.any.assessment` reads every name |
| `evaluation.<name>.value`, `feedback.<name>.value` | both | The numeric value of a result, compared with a number |
| `evaluation.<name>:*`, `feedback.<name>:*` | both | The traces that evaluator judged, or that carry that feedback label |
| `trace.failed_evaluations` | both | The number of failed results in the trace, compared with a count |

Examples: `status:error`; `fell_back:true -cache:hit`; `model:chat* duration>2s`; `trace.errors>=1 origin:app`; `evaluation.helpfulness.assessment:fail -evaluation.groundedness.assessment:fail`; `feedback.thumbs.value<1 session:*`.

Evaluation and feedback terms are answered from the evaluation results first and then applied to the spans, because results live with their team's telemetry. A term reads the results on a span or a trace written from the start of the time range to a day after its end (a judge finishes after the request it judged) and matches at most the 2,000 most recently judged traces; when it matched more, the answer has `evaluation_filter_truncated: true` and the screen says to shorten the range.

### Figures and chart

Above the list, the **figures** of the query's rows: the median and 95th-percentile duration, the rows in error, the tokens in and out and, for a reader who sees cost, the cost. They follow the query, the scope and the time range, like the count.

**Chart** draws the query over time. Three choices beside it, remembered in your browser:

| Choice | Values |
| --- | --- |
| Metric | **Count**, **Errors**, **Mean duration**, **Tokens** (input plus output), **Cost** (only for a reader who sees cost) |
| Breakdown | **No breakdown**, **Status**, **Origin**, **Team**, **Model** |
| Form | **Over time** (one stacked bar per interval; a mean shows the largest group of each interval) or **Top list** (one bar per group with its total) |

The five largest groups have a color each and the rest are **other**; a group's name is a button that adds it to the query (`model:chat-default`), so a spike is one click away from its traces. The plain count over time needs no extra read: it is the strip the facets read already carries.

A row whose request has **comments** shows their count beside its name (for readers of evaluations); the comments themselves are on the detail's Annotations tab.

### Facets

The rail counts the rows of the current query by status, origin, model, team, fallback, cache and guardrail flag (and, for spans, by kind and provider); a click adds or removes the term. For traces it also offers **Span errors in trace** (1, 2 or 5 or more) and **Failed evaluations in trace**. With evaluation results it lists **one facet per evaluator and per feedback label**, with its pass and fail counts; a click filters to the traces with that verdict. Evaluator counts are the results written in the time range in your teams; the other terms of the query do not narrow them.

Each facet lists its 50 most frequent values.

## The detail

A row opens the trace as a drawer; **Full page** opens it at `#/traces/<trace_id>?span=<span_id>&view=<tree|waterfall|graph>&tab=<tab>`. The address follows the selection, so **Copy link** gives a link to exactly this span, view and tab.

The header shows the root span's name, the kind of trace (single request, request chain, agent run, judge trace, application trace), chips for the session and the end user (a click lists their traces), the origin and the models, then the counters: evaluations **failed · passed · neutral · pending**, errors, duration, cost, tokens, spans, model calls and tool calls. A cost with an unpriced attempt is marked **partial cost**, and its tooltip names the attempt. With `evals:manage`, **Add to dataset** and **Review** send the trace's request to a dataset (from its captured content) or to a review queue. **Open in logs** and **Open in APM** appear when `spans.log_link_template` and `spans.apm_link_template` are set (see [Traces and the span store](/docs/features/traces/#settings)). Opened from a list, the arrows go to the previous and next row.

With `evaluators`, the Evaluations tab also lists the evaluator runs the trace still waits for as **Pending · up to N min**: a [trace evaluator](/docs/features/evaluators/#scopes-and-when-a-run-happens) judges a trace once it stayed idle for its window (`pending_evaluations` on `GET /api/v1/admin/traces/{trace_id}`).

The chips also name the **review queues** the trace's requests are in (for readers of evaluations; a click opens Evaluations) and, with `request_replay`, the **replays**: *Replayed: <request>* on the original, *Replay of <request>* on the replay, each a link to the other trace.

Three views of the same spans:

- **Tree**: one row per span under its parent, with its kind, name, a bar on the trace's time line and a metric (duration, tokens or cost). An error marks its span **Error** and every ancestor with **!**, so a failure deep in an agent run is visible from the root. A judged span carries a badge of its results. Rows collapse and expand (**Expand all**, **Collapse all**, or the left and right arrows).
- **Waterfall**: a time ruler with round ticks that adapt from seconds down to microseconds and never run past the end of the trace; one bar per span by its start offset and width, coloured by kind, with its name, duration and metric on or beside it; parallel calls overlap in time on their own rows, so concurrency is visible. **Zoom** in and out (up to 64×) and **Fit**; the strip above the ruler is the whole trace, with the visible part outlined, and a click on it moves the view. **Show evaluation runs** adds a lane with a marker on each judged span.
- **Graph**: the steps of an agent run (requests, tool calls, judge and application spans) as cards with their duration and cost, inside one box per agent; a box collapses and expands. A **solid** arrow is a link the gateway **observed** (a parent span or a span link); a **dashed** arrow is one the client only **asserted** through its agent, turn or parent-session headers (two consecutive calls of one agent, a child session). The agent a step belongs to is always asserted. A single request has no graph, and the view says so.

In every view, **Find in trace** filters by name, kind, model, provider, span ID or request ID (keeping the ancestors of what matches), **Model calls only** and **Errors only** narrow the rows, **Guardrails** hides or shows guardrail spans (a guardrail's row carries its outcome), **Evaluation badges** and **Models** choose what a row shows, and the **error navigator** steps through the spans in error (also the `e` key). The up and down arrows (or `j` and `k`) move the selection and `a` opens the Annotations tab. The metric and these display options are remembered in the browser. Only the rows on screen are drawn, so a trace at the 2,000-span bound opens in well under a second.

Below 900 px the selected span opens as a full-screen sheet with its tabs as a scrolling strip; below 720 px the graph asks for a larger screen, the tree stays complete and the waterfall pans sideways under a pinned ruler.

### The span's tabs

| Tab | What it shows |
| --- | --- |
| **Span** | Status, timing, model and provider, tokens and cost; the agent the client declared, marked *asserted*; on a request span, with `evals:manage`, links to add its request to a dataset or a review queue; for a provider attempt its charge line; the attributes; the events (failure causes, retries, fallbacks, refusals), with an error block for a span in error; the links to judge or evaluated traces; and, on a request span, **Input and output** (below) |
| **Evaluations (n)** | The results of evaluators (LLM judges, code, the API) on this span: the verdict, the value, the reasoning for readers of the sent view, the evaluator version, a pending, skipped or error state with its reason, **View judge trace**, and how the evaluator did over the past 7 days ("78% of 40 results passed") with **View evaluated traces**. On a judge run's own trace the header says what it judged, with **View evaluated trace** |
| **Feedback (n)** | End-user feedback sent with `POST /v1/scores` and `source: feedback` |
| **Logs (n)** | The gateway's own records, below, with a **Span \| Trace** switch |
| **Annotations (n)** | Human results and the comments on the span's request. With `evals:manage` you can add a result (pass or fail, a score, a label or a text, with a rationale) on the selected span and a comment that may mention a console user |

### Logs: the gateway's own records

The gateway does not store your application's log lines. It stores its own records of each request, which is what you look for when one misbehaves. The Logs tab lists them for the selected span or for the whole trace, each with its time, its kind and a link to the screen that holds it:

| Kind | Record | Shown to |
| --- | --- | --- |
| `request_log` | The request log row; opens the request and its journey | Every reader of the trace |
| `charge_line` | One provider send with its outcome and cost state (`attempt_charge_lines`) | Readers who see cost |
| `delivery_receipt` | The durable usage receipt (`durable_usage`) | `analytics:read` |
| `quota_reservation` | The quota reservation and its settlement | `quotas:read` |
| `guardrail` | A guardrail's outcome and number of findings | Every reader |
| `span_event` | A failure cause, a retry, a fallback, a refusal | Every reader |
| `content_capture` | The captured record's metadata (never its content) | `content_structure:read` of the team |
| `evaluation` | An evaluation result of the trace | `evals:read` |
| `alert` | An alert whose detail names the trace or one of its requests (`alert_rules`) | `alert_rules:read` |
| `audit` | An admin audit entry carrying one of the trace's request IDs | `audit:read`, gateway-wide roles |

A span's records are those that name the span, plus, for a request span, the records of its request (and for a provider attempt, its request's charge lines). The switch shows both counts at once, and they differ: a trace has more records than any one of its spans. Each kind lists at most 200 records. **Open in logs** is your own log backend, through `spans.log_link_template`; the gateway's stdout and OTLP log lines carry the same `trace_id` and `span_id`.

### Input and output, images and audio

A span never holds content. On a request span the detail shows what [content capture](/docs/features/content-capture/) kept for that request, and only what your role may read. Every read goes through the same two content routes as the rest of the console (`POST /api/v1/admin/content-captures/{id}/reveal` and `.../media/{media}`), which decide by the [content permissions](/docs/features/content-capture/#who-reads-what) of the record's team, are answered with `no-store` and are written to the audit log. Nothing is read until you press **Show input and output**.

| You hold, for the request's team | You see |
| --- | --- |
| Nothing | A note that content is shown to readers with a content permission |
| `content_structure:read` | That a record exists, with what it kept and until when; the content is not yours to read |
| `content_sent:read` | The conversation as it was sent to the model (after the input guardrails) and the answer, as text. Images, audio and reasoning are replaced by a mark that says what was there |
| plus `content_reasoning:read` | The model's reasoning, in its own collapsible block |
| plus `content_media:read` | **Images and audio inline**: an image is drawn in the message that carried it and audio gets a player, each fetched from the media read route. An attachment over a capture bound shows why it has no bytes |
| `content_received:read` (named users only) | **Raw JSON**: the request exactly as the client sent it, beside the sent view and the response |

The conversation is drawn as a chat with tool calls as their own blocks; **Raw JSON** shows the exchanged bodies for readers who hold them. Media types the gateway serves inline are PNG, JPEG, GIF and WebP images and common audio types; anything else is offered as a file. Media needs `content_capture_media`; reasoning as its own part needs `content_capture_reasoning`.

## Configuration at the time

A stored trace says which configuration served it. With `trace_explorer` on, every request span carries:

| Attribute | What it is |
| --- | --- |
| `config_fingerprint` | 16 hexadecimal characters over the hash of every section of the configuration the request was served with. It is computed once when a configuration is loaded, never per request, so every replica shows the new fingerprint from the first request after a change |
| `config_version` | The control version of that configuration (the number a configuration write advances) |
| `policy_revisions` | The revisions of the policies the request read: its team's policy (`team_policies[<team>]`), its model (`models[<model>]`) and its provider (`providers[<provider>]`). With `team_policy_enforcement` the team's revision is taken from the policy in force when the request was admitted, so a policy changed from the console or the API (stored outside the configuration file) shows as changed too |
| `translation_lossy` | What a translation between APIs approximated or left out for this request (for example `cache_control,service_tier`), the same list as the `X-Gateway-Translation-Lossy` response header |

The gateway keeps, by fingerprint, one hash per section (`models[chat-default]`, `team_policies[platform]`, `features.usage_valuation`, `guardrails[pii-in]`…): hashes only, never a value of the configuration.

On the **Span** tab of a request span, **Configuration at the time** shows the fingerprint and version then, whether the same configuration is in force now, and for each policy the request read whether it is **unchanged**, **changed since**, **added since** or **removed since**. A gateway-wide reader of the configuration (`config:read`) also sees **Sections that differ**: the names of every section changed, added or removed between then and now. A team role sees the state of its own request's policies, not the other sections.

Two requests on either side of a configuration change show different fingerprints, and the later one's comparison with the earlier names the changed sections; that is how you tell "the model was repointed" from "the provider was slow".

## Replay a request

With `request_replay` on, an operator can send a stored request again. **Replay** is on the trace detail's header and on a request's details in the request log, for a session that holds `requests:replay` and `content_sent:read` of the request's team.

1. **Replay** asks for confirmation and says what it does: the captured content is sent again, as you, on your limits, and it spends.
2. The gateway reads the record's **sent view** (the request after the input guardrails, as the [capture policy](/docs/features/content-capture/) kept it), clears `stream`, and sends it as a **new request** to the same API.
3. The answer shows the new request ID, its HTTP status and the answer's text, with **Open the replay's trace**.

| What | How a replay behaves |
| --- | --- |
| Identity | The operator's own: key ID `replay:<team>:<user>`, the console user as principal and key owner, in the request's team. Never the original caller's key, IDs or budget |
| Limits and policy | Everything a request of that team goes through: team policy, plan, rate limits, quotas, budgets, guardrails, capture, the ledger and cost |
| How it is recorded | Origin **replay** on the request log row and the span (`origin:replay` in the explorer and in Usage and Cost by origin), `parent_request_id` the original, `replay_of` on the replay's request span, and a link both ways on the two traces |
| Audit | The read of the captured content (`content_capture.read`, `view:replay`) before anything is decrypted, and the replay itself (`request.replay`, with the original and the new request) |
| What it covers | Chat Completions, Messages and Responses requests |

A replay is refused with the reason, and nothing is sent, when:

| Answer | Why |
| --- | --- |
| `409 content_not_captured` | No captured record of this request among the teams you read. The gateway never replays invented input |
| `409 content_not_replayable` | The record keeps no sent view (the policy keeps the received view only), was cut at the policy's `max_bytes`, holds images or audio kept apart from the body, or is another kind of request. The message says which |
| `409 replay_team_required` | Two teams you read have a request with this ID: name the team (`team_id`) |
| `403 role_forbidden`, `content_read_forbidden`, `team_forbidden` | No `requests:replay`, no `content_sent:read` of the team, or a session that may not run calls as that team (a reader of a team's content through a `content:read` grant who is not a member of it, or a global role narrowed by a custom role: the button shows by permission, the server decides by team). The shared API token and scoped credentials never replay |
| `404 feature_disabled` | `request_replay`, `content_capture` or `evaluation_tracing` is off, or the team's plan does not include replay |

A replay that was sent and then refused by a guardrail, a limit or the provider is a replay like any other: `200` with the new request's own `status` and error.

| Role | `requests:replay` |
| --- | --- |
| Administrator | Yes, any team |
| Organization admin | Yes, inside its organization |
| Team administrator | Yes, on administered teams |
| Operator, viewer, team viewer, user | No |

A [custom role ceiling](/docs/features/custom-roles/) can withhold `requests:replay` and never grants it beyond the base role.

## Links both ways

| From | To |
| --- | --- |
| A request log row, the request details, the request journey | **Open trace**: the trace detail on that request's span |
| A span | Its request log entry and journey (the request ID on the Span tab, or the `request_log` record) |
| An evaluation result, anywhere it is shown | The span it judged, and **View judge trace** |
| A judge trace | **View evaluated trace**, on the judged span; **View evaluator** |
| A judge's own request in the request log | *Judge of* the request it judged |
| A session or end-user chip, an evaluator's context line | The explorer, filtered to that session, end user or evaluator |
| **Usage**: a row of a breakdown, its error count, or the whole selection | **View traces**: the explorer on the same slice (`model:`, `team:`, `origin:`, `end_user:`; a provider, key or principal moves it to request spans) and the same time window; the error count adds `status:error` |
| A group of the explorer's chart | The explorer, filtered to that group |
| A queue chip, a replay chip | Evaluations; the original or the replay's trace |

## API

The explorer's routes need `trace_explorer`, `span_store`, `usage_analytics` and `logs:read`, are filtered by the reader's teams in the query (and, for each team, to what it recorded in its [current organization](/docs/features/evals/#targets-after-a-team-moves)), and answer `Cache-Control: private, no-store`. Replay has its own flag and permission.

| Route | What it returns |
| --- | --- |
| `GET /api/v1/admin/traces` | The list. Parameters: `scope` (`traces`, the default, or `spans`), `q`, `from` and `to` (RFC 3339; default the past 24 hours, at most 92 days apart), `lens` (`overview`, `evaluations`, `feedback`), `limit` (1 to 200, default 50), `cursor` (the previous answer's `next_cursor`), `content=true` (previews, at most 50 rows) |
| `GET /api/v1/admin/traces/facets` | The exact `total` and the facet counts of the same `scope`, `q`, `from` and `to`. `field` limits it to one facet (or `evaluation`); `histogram=true` adds the count over time in at most 60 buckets; `stats=true` adds `stats`: `rows`, `duration_p50_us`, `duration_p95_us`, `duration_avg_us`, `input_tokens`, `output_tokens`, `errors` and, for a reader who sees cost, `cost_usd` |
| `GET /api/v1/admin/traces/chart` | One metric by one breakdown for the same `scope`, `q`, `from` and `to`: `metric` (`count`, `errors`, `duration`, `tokens`, `cost`), `by` (`none`, `status`, `origin`, `team`, `model`). `series` has at most the eight largest groups and `other`, each with its `total` and one point per interval of `step_seconds` |
| `GET /api/v1/admin/traces/{trace_id}/configuration?span_id=` | [Configuration at the time](#configuration-at-the-time) of a request span against now |
| `POST /api/v1/admin/requests/{id}/replay` | [Replay](#replay-a-request). Optional JSON body: `team_id` (when two teams you read have a request with this ID) and `capture_id` (the record, when one team used the ID more than once; the console sends the one the trace names). Needs `request_replay`, `requests:replay`, `content_sent:read` and the CSRF token |
| `GET /api/v1/admin/traces/fields` | The fields you may use, with their type, values, scopes and a line of help; the syntax, examples and limits |
| `GET /api/v1/admin/traces/{trace_id}/records` | The Logs tab: `scope=trace`, or `scope=span` with `span_id`; `records`, `counts` for both scopes, `truncated` and `log_link` |

```bash
curl -s -b cookies.txt "https://gateway.example.com/api/v1/admin/traces?q=status:error%20model:chat*&from=2026-11-24T00:00:00Z&to=2026-11-25T00:00:00Z&limit=2"
```

```json
{
  "scope": "traces", "lens": "overview", "engine": "database",
  "from": "2026-11-24T00:00:00Z", "to": "2026-11-25T00:00:00Z", "query": "status:error model:chat*",
  "data": [
    {"team_id": "platform", "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736", "first_at": "2026-11-24T15:02:11.482113Z", "last_at": "2026-11-24T15:02:12.394523Z", "duration_us": 912410,
     "root_span_id": "b7ad6b7169203331", "root_request_id": "req-1", "root_name": "POST /v1/chat/completions", "origin": "app",
     "spans": 4, "requests": 1, "llm_calls": 2, "tool_calls": 0, "errors": 1, "fell_back": true, "cache_hits": 0, "guardrail_flags": 0,
     "cost_state": "partial", "cost_usd": "0.00002", "input_tokens": 10, "output_tokens": 5, "models": ["chat-flaky"], "session_id": "sess-9",
     "evaluations": {"failed": 1, "passed": 1, "neutral": 0, "pending": 0, "errors": 0,
       "results": [{"id": "score_1", "name": "helpfulness", "source": "llm", "scope": "span", "span_id": "b7ad6b7169203331", "assessment": "fail", "status": "ok", "metric_type": "boolean", "value": 0}]}}
  ],
  "has_more": true, "next_cursor": "eyJ2IjoxLCJ0IjoiMjAyNi0xMS0yNFQxNTowMjoxMS40ODIxMTNaIiwiaWQiOiI0YmY5…",
  "valuation_shown": true, "evaluations_shown": true, "evaluation_filter_truncated": false, "content_shown": false
}
```

A span row has the span's own columns (`span_id`, `kind`, `name`, `started_at`, `duration_us`, `status`, `model`, `provider`, tokens, cost) without its attributes and events, which are in the detail. With `lens=evaluations` or `lens=feedback` the answer has `cards`: per name, `pass`, `fail`, `none`, `total`, the `mean` of numeric values and up to 12 `labels`. A row's `evaluations.results` lists its first 24 results and `more` counts the rest; one page reads at most 1,000 results for its rows (the newest), and says `evaluations_truncated: true` when it reached that. With `content=true`, a row's `content` is `{"state": "shown", "input": "…", "output": "…"}` (240 characters each, text only), `withheld` when a record exists that you may not read, or `not_captured`; it is absent when you hold no content permission for the team.

```json
{
  "scope": "traces", "total": 1840,
  "facets": {
    "status": [{"value": "ok", "count": 1786}, {"value": "error", "count": 54}],
    "model": [{"value": "chat-default", "count": 1502}, {"value": "chat-flaky", "count": 338}],
    "fell_back": [{"value": "false", "count": 1750}, {"value": "true", "count": 90}]
  },
  "max": {"trace.errors": 3, "trace.spans": 41},
  "evaluators": [{"name": "helpfulness", "source": "llm", "pass": 1310, "fail": 212, "none": 4, "total": 1526}]
}
```

```json
{
  "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736", "scope": "span", "span_id": "b7ad6b7169203331",
  "counts": {"trace": 9, "span": 6}, "truncated": false,
  "records": [
    {"time": "2026-11-24T15:02:11.482Z", "kind": "request_log", "title": "Request log: chat chat-flaky", "detail": "HTTP 200, 912 ms, backup", "request_id": "req-1", "status": "ok", "link": "request", "link_id": "req-1"},
    {"time": "2026-11-24T15:02:11.482Z", "kind": "charge_line", "title": "Charge line: attempt 1, primary model-a", "detail": "provider_error, cost unknown, HTTP 500", "request_id": "req-1", "status": "error", "link": "request", "link_id": "req-1"},
    {"time": "2026-11-24T15:02:11.784Z", "kind": "span_event", "title": "Span event: attempt_failed", "detail": "http_status: 500, outcome: provider_error", "request_id": "req-1", "span_id": "5c1f7e0a9d3b4c21", "status": "error"}
  ]
}
```

```bash
curl -s -b cookies.txt "https://gateway.example.com/api/v1/admin/traces/chart?q=status:error&metric=count&by=model&from=2026-11-24T00:00:00Z&to=2026-11-25T00:00:00Z"
```

```json
{
  "scope": "traces", "metric": "count", "by": "model", "unit": "rows", "step_seconds": 1800,
  "series": [
    {"key": "chat-flaky", "total": 41, "points": [{"at": "2026-11-24T15:00:00Z", "value": 38}, {"at": "2026-11-24T15:30:00Z", "value": 3}]},
    {"key": "chat-default", "total": 13, "points": [{"at": "2026-11-24T09:30:00Z", "value": 13}]}
  ],
  "metrics": ["count", "errors", "duration", "tokens", "cost"], "groups": ["none", "status", "origin", "team", "model"]
}
```

```bash
curl -s -b cookies.txt "https://gateway.example.com/api/v1/admin/traces/4bf92f3577b34da6a3ce929d0e0e4736/configuration?span_id=b7ad6b7169203331"
```

```json
{
  "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736", "span_id": "b7ad6b7169203331", "recorded": true,
  "fingerprint": "5779307cefd254ce", "version": 41, "current": {"fingerprint": "70b2aef6ad7de9dd", "version": 42}, "same": false,
  "policies": [{"section": "team_policies[platform]", "state": "unchanged"}, {"section": "models[chat-flaky]", "state": "changed"}, {"section": "providers[primary]", "state": "unchanged"}],
  "changes_shown": true, "known": true, "changed": ["models[chat-flaky]"], "added": [], "removed": [], "first_seen": "2026-11-20T11:03:27Z"
}
```

```bash
curl -s -b cookies.txt -H "X-CSRF-Token: $CSRF" -X POST "https://gateway.example.com/api/v1/admin/requests/req-1/replay"
```

```json
{
  "replay_of": {"request_id": "req-1", "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736", "team_id": "platform"},
  "request_id": "7cfb0e0110144f171bca45dfb030e95d", "trace_id": "062799751bf78956133ccf0bf47c0af5", "status": 200, "origin": "replay",
  "output": "Lisbon."
}
```

Errors: `400 invalid_query` (the message names the problem and the fields), `400 invalid_range`, `400 invalid_request`, `404 feature_disabled`, `404 trace_not_found` or `span_not_found` for the records of a trace or span you cannot see, `503 query_timeout` when a read takes more than 10 seconds (shorten the range or add a filter), `503 analytics_store_unavailable` and `503 storage_unavailable`.

The trace itself is still read with `GET /api/v1/admin/traces/{trace_id}` ([Traces and the span store](/docs/features/traces/#read-traces)); with the explorer it also answers `team_id`, the team of the spans when one team owns them all. The reveal route answers, to readers of the sent view with reasoning and media, the same exchange as a list of messages (`conversation`) and the answer's text (`answer`), beside the exchanged bodies.

## The two span engines

The explorer reads whichever engine holds the spans (`spans.engine`, see [where spans are stored](/docs/features/traces/#where-spans-are-stored)), with the same answers:

- With `engine: database`, the list reads the trace summaries and the span partitions of PostgreSQL.
- With `engine: analytics_store`, it reads the analytics store. A trace's figures there are the sum of the rows each write added; the list picks its page from them and then reads the page's own rows by key, so a row and its detail always show the same numbers.

Both were measured with the same data; the figures and how to choose are in [Trace explorer reads](/docs/performance/trace-explorer/). In short: lists of traces and opening a trace are fastest on PostgreSQL (1 to 5 ms a page at a million traces, because a page reads the newest hour first); the facet rail, the exact total and the count over time are fastest on the analytics store (25 to 100 ms whatever the range, against 0.4 to 1.6 s on PostgreSQL once a range holds a million rows). The database is enough while the ranges your readers open hold up to a few hundred thousand spans; use the analytics store engine when they hold millions and the facets matter.

## Limits

- The lists read live spans. A trace kept past retention because it was annotated still opens by its ID or from its request, and is not listed.
- After switching `spans.engine`, the lists show what was written to the engine in use; traces written before the switch still open by ID.
- With `engine: analytics_store`, a trace is listed by the time of its first span, as on the database. To find it, the list reads the rows written from a day before the range to a day after it: a trace that has been receiving spans for more than a day before the range starts, or still receives them more than a day after it ends, is filtered on the part inside those bounds.
- Evaluation and feedback terms match at most 2,000 traces each (above). Evaluator facets and lens cards count results in the time range plus the day after it, since a judge finishes after the request it judged.
- A facet lists 50 values; the detail shows the first 2,000 spans of a trace; the Logs tab lists 200 records of each kind.
- The chart draws the five largest groups of a breakdown and sums the rest; the route answers eight and marks the series that sums the others (`folded`). A trace that used several models counts once under each of them in the model breakdown, as in the model facet. The percentiles are discrete and the same on both span engines.
- A span stored before `trace_explorer` was on has no fingerprint, and a fingerprint from before the gateway kept section lists compares as changed without naming sections.
- Replay covers Chat Completions, Messages and Responses requests whose sent view was captured whole and holds no image or audio; a replay is answered in one piece even when the original streamed.
- `OR`, `NOT`, parentheses, lists, ranges, span fields on a trace, text search over captured content and saved views need [`trace_query`](/docs/features/query-language/). Sessions and users as scopes are not part of this screen yet.

## Upgrade

Migration 210 adds two small tables, `gateway_request_replays` (one row per replay: the two request IDs, the two trace IDs, the team, the operator and the status) and `gateway_config_fingerprints` (one row per configuration the gateway ran with: a hash per section), and lets a stored span carry the origin `replay`, on the live table and on the copy kept past retention. It reads no existing row and takes no long lock. With `trace_explorer` on, a request span gains the attributes above: three map lookups per request, plus, with `team_policy_enforcement`, a 64-bit hash of the team policy's models and scopes; the fingerprint itself is computed when a configuration is published, never per request, and the gateway keeps the prints of the four newest configurations in memory. Turning the flags off hides the screen, the routes and the Replay action; nothing is deleted.

## See also

- [Agent runs](/docs/features/agent-recognition/): the runs of coding agents, recognized from the requests alone, as a list and a thread

- [Traces and the span store](/docs/features/traces/): what a span holds, the settings, retention and the two engines.
- [Evaluation results](/docs/features/evaluation-results/) and [judge calls as linked, labelled traffic](/docs/features/evaluation-tracing/).
- [Content capture](/docs/features/content-capture/): the capture policy, the content permissions and the media store.
- [Access control](/docs/features/access-control/): which built-in role holds which permission.
