---
title: Browse sessions and traces in Studio
description: 'Find a weft/thread session''s turns on Studio''s Sessions pages, and any OpenTelemetry trace, weft or not, on its Traces pages: what each lists, how to filter it, and the API behind it.'
url: https://weftgo.dev/docs/observe/studio/sessions-and-traces/
type: how-to
sources:
  - 'W11-auditB2-fix, v0.20.2: weft/studio/web/src/lib/session-states.ts:20-37, 52-99 (row states), 111-163 (SESSION_FILTERS, SESSION_STATUSES, SESSION_SINCE, sinceOf); weft/studio/web/src/routes/sessions.index.tsx:63-109, 169-200, 253-300 (the chips and their keys); weft/obsdb/db.go:710-725, 848; weft/studio/web/src/lib/session-states.ts:271-282 and components/studio/session-actions.tsx:97-212 (export and delete toasts); weft/studio/web/src/lib/scope-switch.ts:1-21, routes/traces.$id.tsx:159-185, 258-263 (scope switch, not a run); weft/studio/web/src/routes/runs.index.tsx:257-284 and lib/honesty.ts:313-330, routes/traces.index.tsx:176-177 (GenAI traces that are not runs)'
  - 'W11-auditB1-fix, v0.20.2: weft/studio/web/src/routes/conversations.$id.tsx:1-9 (the page: every run of a public id, newest first, ?order=oldest, experiments nested, sessions linked, live; the only page of a sessionless public id), 36-45 (LIMIT 500; order), 77-127 (runs?public_id=, sessions?public_id=, live: a run frame refetches, throttled to 1 s), 180-230 (counts, tokens, own and delegated cost, the flat runs list, the sessions line or noSession), 270-291 (orphans, capped); weft/studio/web/src/lib/conversation.ts:74-95 (CONVERSATION words), 14-18 (splitConversation); weft/studio/web/src/lib/links.ts:761-765 (conversationLink); weft/studio/web/src/routes/sessions.$id.tsx:394-403 (the header''s public id links the conversation page); weft/studio/web/src/panel/element.ts:3191-3203 (session ⤢ else conversation ⤢); weft/studio/web/src/components/studio/app-shell.tsx:152-162 (Sessions marked active on /conversations)'
  - 'W11-factcheck4, v0.20.2: weft/studio/web/src/components/studio/session-actions.tsx:94 (export only under the export capability), 135-150 (delete replaced by its reason); weft/studio/web/src/lib/run-actions.ts:141-155 (deleteOffWhy)'
  - 'W11-fix3, v0.20.2: weft/studio/web/src/components/studio/session-actions.tsx:50-62 (the verbs'' order: copy public id when there is one, export, open in app for the newest turn, delete), 115-125; weft/studio/web/src/lib/session-states.ts:264-280 (labels: export jsonl, copy public id, delete session…); weft/studio/web/src/components/studio/run-header.tsx:300-345 (open in app: weft.page_url, else disabled with the reason); weft/studio/api.go:2364-2391 (numberDerivedTurns: 1..n by start, after the thread''s highest; presentation only); weft/studio/web/src/lib/honesty.ts:312 (derived (stock OTel))'
  - 'weft/AGENTS.md:315-345 (block 7: /conversations/$id; delegated sessions priced up to 10,000 runs, 20 pages; the summarizer priced at read time; ?mark=, ?lanes= dims, ?view=tree by weft.turn.parent; { } on a turn''s run page; the export''s caps and lines; the header''s verbs); weft/docs/record-contract.md:1715-1717 (derived sessions numbered 1..n, derived (stock OTel)) — v0.20.2'
  - weft/studio/README.md:2353-2362 (sessions, /traces, /traces/{id}), 2363-2396 (the trace page), 2451-2460 (the sessions text box; titles, not ids), 2506-2507, 2521-2522 (URL keys)
  - weft/studio/web/src/routes/sessions.index.tsx:1-10, 86 (the sessions list), 231-308 (filters)
  - 'W11-tag3, v0.20.2: weft/studio/web/src/routes/sessions.index.tsx:243-246 (the find box w-52: its placeholder whole), 474 (the turns cell, DotWrap); weft/studio/web/src/components/studio/session-state.tsx:43 (awaiting a decision · 1 call, DotWrap); weft/CHANGELOG.md:17 (0.20.2)'
  - weft/studio/web/src/routes/sessions.$id.tsx:1-4, 20, 118-158 (a session page, experiments forked from its turns)
  - weft/CHANGELOG.md:227 (the timeline and entries routes), 228 (the session page opens on the timeline; views), 229 (export, delete session), 247 (status is the newest turn's outcome), 253 (?view=table)
  - weft/studio/web/src/routes/sessions.$id.tsx:40-51 (the forks read beside the session, by public id else agent), 133-143 (experiments could not be read, looking for experiments…, the count and its 2,000-run note)
  - 'weft/studio/web/src/lib/experiments.ts:44-45 (PAGES 4, LIMIT 500), 48-81 (fetchSessionForks: playground runs paged, truncated when the pages run out)'
  - weft/studio/web/src/routes/traces.index.tsx:1-8, 47, 187-212 (the trace list and its filters)
  - weft/studio/web/src/routes/traces.$id.tsx:1-8, 57 (a trace page)
  - weft/studio/web/src/lib/title.ts:261-289 (traceTitle, traceRunsWords; (no root span))
  - weft/obsdb/db.go:748-749 (sessions group top-level, non-playground runs)
  - weft/studio/web/src/lib/waterfall.ts:1386-1394 (t:<run>:<span> keys)
  - 'weft/studio/web/src/lib/run-filters.ts (rangeTime: the UI converts a bare day); weft/studio/traces.go:21 (since is RFC 3339)'
  - 'weft/studio/api.go:889-1065 (sessionRow, sessionsPage, sessionDoc), 2252-2266 (serveSessions), 2413-2430 (serveSessionRoutes), 2863-2898 (sessions/{id}/public_id: the dev token''s alone)'
  - weft/studio/traces.go:14-65 (GET /api/traces parameters, panel-token scope, the row), 93-112 (the root run and failed count), 192-193 (the gap badge)
  - weft/studio/routes.go:225-229 (DELETE /api/sessions/{id}), 311-313 (session routes)
  - weft/AGENTS.md:298-346 (traces, traces/{id}, sessions, sessions/{id}, sessions/{id}/public_id, DELETE sessions/{id})
  - weft/CHANGELOG.md:343 (session titles, first_prompt, SessionQuery.Q), 452-466 (SessionQuery.PublicID scopes the turns; /api/sessions?public_id=), 863 (the trace page's selections and chat view), 1057-1079 (GET /api/traces), 1080-1083 (obsdb.DB.Traces), 2255 (GET /api/sessions/{id}/public_id)
  - 'observed: weft studio v0.17.0 over weft-arena''s offline seed — /sessions, /sessions/<Acme support desk>, /traces, /traces/<rw.deep-delegation trace>'
  - 'weft v0.20.2: weft/CHANGELOG.md:227 (0.18.0: the session timeline index, session_events / weft_session_events, backfilled, runless included), 228 (0.18.0: the session page: a skipped turn said with its receipt, gaps one not_recorded hole, a busy policy''s end neutral), 240 (0.18.0: a busy-policy end reads neutral; any other cancel keeps red), 259 (0.18.0 upgrade note: sessions before 0.18.0 show only compaction markers); weft/docs/record-contract.md:839-849 (thread records indexed by session)'
---

# Browse sessions and traces in Studio

A [session](https://weftgo.dev/docs/reference/glossary/#session) recorded by `weft/thread` shows up on Studio's **Sessions** page: one row per conversation, and a page per session that opens on a timeline of its [turns](https://weftgo.dev/docs/reference/glossary/#turn). Any OpenTelemetry trace in the database, from weft or from any other instrumented app, shows up on the **Traces** page, with a span tree per trace. Both are in the sidebar and in the ⌘K palette.

## Sessions

`/sessions` lists every thread session, most recently seen first. A row shows the newest turn's status, the session's title with its id and public id under it, the agent, the number of turns, tokens in and out, the cost (turns' own plus their subagents', under `pricing`), and when it was last seen. Since 0.18.0 a row also says what state the conversation is in: `⏸ awaiting a decision · 1 call` when its newest turn is parked with no resume yet; an outcome strip of its newest 40 turns, oldest first, one glyph per turn (`✓` succeeded, `✗` failed, a neutral `✗` ended by a newer message, `●` running, `◌` interrupted, `⊘` cancelled, `⏸` parked or decided); the failed, busy-ended and cancelled turns counted apart, only failures in red (`1✗ failed`, `2✗ ended by a newer message`, `1⊘ cancelled`); and `3 exchanges · 5 turns` when resumes fold turns into exchanges. In a narrow column `awaiting a decision · 1 call` and `1 exchange · 2 turns` break only at their dot.

The title is the session's own when the app named one: [`thread`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/thread)'s `SetInfo` title, recorded on every later turn as the `weft.session.title` metadata, which survives a content-off destination. Without one the row is titled by its first turn's prompt, then "(content not captured)" when that turn stored no content, then the id.

![Studio's sessions list with its status, time and kind filters: each row's status, title (Order 4411 refund, Checkout latency watch) or first prompt, its session and public id, agent, turns, tokens in / out, cost and last seen](https://weftgo.dev/docs/_astro/studio-sessions.light.UJweMVYp.webp)

*The sessions list: titled sessions (Order 4411 refund, Checkout latency watch) and untitled ones under their first prompt, with the status, time and kind filters above.*

Three boxes filter the list, each a key in the URL; the third is wide enough to show its placeholder, "find title, prompt, id", whole:

| Box | URL key | Matches |
|---|---|---|
| agent | `agent` | The agent's name |
| public id | `public_id` | The sessions one of whose turns carries this public id |
| find title, prompt, id | `q` | Every term in the title, the first turn's prompt, the id, the public id or the agent |

A `public_id` filter scopes the whole row to that public id: its turns, usage, first and last seen, status and cost are the turns carrying it, so another app's runs that share the session id change nothing.

Since 0.18.0, one wrapping row of chips under the boxes, in three groups split by dividers, filters by state. A chip toggles its URL key, and every chip you turn on narrows the list further:

| Chip | URL key | Keeps the sessions |
|---|---|---|
| `⏸ awaiting a decision` | `awaiting=1` | whose newest turn is parked with no resume yet |
| `✗ has a failed turn` | `failed=1` | with a turn whose loop returned an error. A turn ended by a newer message, or cancelled, is not a failure |
| `⌗ compacted` | `compacted=1` | that `weft/thread` compacted: a compaction marker is in the session's state log |
| `↳ delegated` | `lineage=child` | another session delegated (`thread/pool`) |
| `⑃ forks` | `lineage=fork` | a `Fork` made from another session |
| `✓ succeeded`, `✗ failed`, `● running`, `◌ interrupted` | `status=succeeded` … `status=interrupted` | whose newest turn has that outcome. `failed` leaves out a newest turn that was cancelled or ended by a newer message, and `succeeded` leaves out a parked one: for that, use `awaiting` |
| `last hour`, `last 24 h`, `last 7 days` | `since=1h`, `24h`, `7d` | last seen within that window |

`↳ delegated` and `⑃ forks` share the one `lineage` key, so only one of them is on at a time; the same goes for the status chips and for the window chips. The window is measured from when the first page loads, and the pages after it keep that bound, so the list does not shift while you scroll. A refresh measures it again. A link with a value the list does not know drops that key.

### A session's page

`/sessions/<id>` heads with the title, the newest turn's status, the agent, the turn count and tokens, the public id and when it was last seen. Since 0.18.0 the page opens on the timeline: one row group per exchange (a turn and the resumes that decided its parked calls) on a shared time axis, with each turn's state-log marks under it. `?view=table` is the turns table, newest first (`&order=oldest` for the old order): one row per turn with its status, the turn number with its prompt ("t3 Here is the photo of the cracked dripper…"), agent, steps, tokens and start. Each turn's title links its run page. `?view=tree` draws the lines the turns continue, and `?view=approvals` every decision and grant. A link made before 0.18.0 for the turns table adds `?view=table`.

On the timeline, each mark opens a drawer, and `?mark=<id>` in the URL names the open one. The lanes filter, `?lanes=`, dims the lanes you did not pick and never hides them. The tree view follows `weft.turn.parent`: a turn after a `Branch`, `Uncompact` or rollback continues the turn it names, so abandoned turns sit off the path and forks hang on their origin. The page stays live over `/api/live?session=`. On a turn's run page, `{` and `}` step to the previous and next turn of its session.

The marks are the session's [state log](https://weftgo.dev/docs/reference/record-contract/#thread): every `thread` record and compaction marker with a `weft.session.id`, indexed by session as it is ingested (SQLite's `session_events`, ClickHouse's `weft_session_events`, both backfilled), records filed under no run included. A mark reads in the state log's words, and a skipped turn number is said with the receipt that took it ("t2 · consumed by a steer · delivered into t1"); a gap nothing explains is one `not_recorded` hole. A turn a busy policy ended reads neutral, not failed, here and on its run page: "✗ interrupted by t7", "↶ rolled back by t9 · off path" (`weft.cancel.cause` `thread.interrupted`); a cancel with any other cause keeps the failure's colour. A session recorded before 0.18.0 shows only compaction markers on its timeline, since the `thread` records start with 0.18.0, and a turn there that parked or resumed reads the `not_recorded` hole.

The header's cost covers the session's turns and its delegated sessions, `thread/pool` children at any depth. A session is priced up to 10,000 runs, and a level's reads stop at 20 pages; past either, the figure is unknown with a reason. The summarizer's calls (compaction) are priced at read time, never added to usage, and the page draws them as their own line. The header's verbs, in order, are **copy public id**, **export jsonl**, **open in app** and **delete session…**. **copy public id** shows only when the session has one, and **export jsonl** only under the `export` capability. Where Studio cannot delete (no `delete` capability, a panel token, or neither the dev token nor a loopback `Host`), **delete session…** is replaced by a line saying why. **open in app** opens the newest turn's host page (`weft.page_url`); without one it is disabled and says why. **export jsonl** says `saved <file>` or `export refused: <reason>` in a toast. **delete session…** asks first (`Delete session <id>?`, naming how many turns go); done, a toast says `deleted session <id>` and the page returns to the list, and a refusal stays in the dialog as `delete refused: <reason>`.

A session can be made of [derived runs](https://weftgo.dev/docs/observe/other-languages/#derived-runs): the conversation of a stock OpenTelemetry app. Since 0.20.0 the page numbers its derived top-level runs 1 to n by start order, after the thread's highest turn, for display only. A session whose every run is derived is badged "derived (stock OTel)".

A turn that resumed a park and carried no new prompt reads "resume of t1 · 1 decided call", and the parked turn before it reads `parked → t2`, a link to it. Playground experiments forked from a turn are listed under it, and the page ends with the count: "0 experiments forked from these turns". Studio finds them by reading the playground runs beside the session, scoped to its public id (else its agent), up to 4 pages of 500. When more remain, the count covers only those 2,000 and adds `— only the newest 2,000 playground runs were searched`; an older experiment forked from a turn is then neither listed nor counted. While the read runs the line says `looking for experiments…`, and a failed read says `experiments could not be read: <error>`.

The sessions list's status is the newest turn's outcome: `succeeded`, `failed`, `running`, `interrupted`, `cancelled`, `ended` (a busy policy ended it), `parked` or `resumed`. Before 0.18.0 a cancelled or busy-ended turn read `failed` and a parked one `succeeded`. The turn rows use the [full vocabulary](https://weftgo.dev/docs/observe/studio/runs/#status-words), `parked` and `cancelled` included.

### A conversation's page

`/conversations/<public id>` (0.18.0) is a public id's page: every run that carries it, the handle the devtools panel follows. It is the only page a public id without a thread session has, such as a test harness's or a non-thread app's. A public id with sessions lists them, each linked to its own page with its state. Otherwise the page says `no session carries this public id — the runs are its conversation`.

The table lists the turns newest first, as the panel and the session table do; `?order=oldest` reverses it. Playground experiments forked from a turn sit under that turn. Experiments whose source turn is not on the page are listed apart, as `N experiments of runs not on this page`. The header counts the turns, the exchanges too when a turn resumed another, and the experiments, then the tokens in and out. Under `pricing` it shows the turns' own cost and, apart, `+ $y delegated` for their subagents, never folded together.

The page reads `GET /api/runs?public_id=` once, up to 500 runs; past that it says `showing the newest 500 runs of this public id — the runs list pages through all of them`. **the flat runs list** opens `/runs?public_id=<id>`. Under the `live` capability the page stays live: a run frame of the public id re-reads it, at most once a second.

Two links lead here: a session header's public id, and the panel header's `conversation ⤢`. The panel shows that button when its scope has a public id but no session; with a session it shows `session ⤢` instead. The sidebar marks **Sessions** while it is open.

### Session routes

| Route | Answers |
|---|---|
| `GET /api/sessions` | The rows above; `agent`, `public_id`, `q`; paged by `before` and `before_id` (on last seen) with `limit` |
| `GET /api/sessions/{id}` | The row and its top-level turns in order |
| `GET /api/sessions/{id}/timeline` | The turns and the state log's marks the timeline draws (capability `timeline`) |
| `GET /api/sessions/{id}/entries` | The same marks paged by `offset` and `limit`; `run` narrows to one run's |
| `GET /api/sessions/{id}/export?format=jsonl` | The conversation as JSON lines, streamed: a session line, every turn's run export in turn order (at most 200 turns), the state log's marks (at most 2,000), holes, and a closing `session_end` line. Past 64 MiB it ends with a `truncated` hole, cause `response_cap` |
| `GET /api/sessions/{id}/public_id` | The public id the session's turns carry, or `""` with the `not_recorded` badge |
| `GET /api/public/{public_id}` | The reverse: the session a public id names |
| `DELETE /api/sessions/{id}` | Deletes the session's runs from Studio's tables (capability `delete`) |

`/api/sessions/{id}/public_id` answers the dev token, or setup A's open API, only: every panel token gets a 403 with the `hidden` badge before the session is looked up. `DELETE` takes the dev token or, with no token, a loopback `Host`; it removes rows, records, the search index, spans and app logs from Studio's database, never your app's session store. The session header's **delete session…** calls it.

Since 0.18.0 a session is grouped over its own turns (runs whose id is `<session>-t<turn>`, or runs linked to no run), not playground runs. A `thread/pool` child session is listed as a session of its own, with its lineage (`parent_session`, `parent_turn`, `parent_call`, `parent_run`), and is counted in `total`; its runs do not appear as rows of the parent's. A client after top-level sessions only skips the rows with a `parent_session`. [What is a session?](https://weftgo.dev/docs/sessions/overview/) covers how a session records its turns.

## Traces

`/traces` lists every trace the database holds, weft or not, newest first. A row shows the title, the root span's name and the trace id, an **error** mark when any span ended in error, the service, the weft runs it holds ("3 runs · 1 failed", linked to the top run), the span count, the start and the duration.

The title is the trace's top run as the runs list words it, the agent and the prompt ("director · How many units …") or either alone, else the root span's name, else "(no root span)". A trace whose root span never arrived (only child spans did) carries the `gap` badge, and a trace of non-weft spans only shows "—" for runs.

Filter it by **service** (a resource service name, exact: the traces holding a span of it), **since** and **until** (a day `YYYY-MM-DD` in UTC, or an RFC 3339 time, on the trace's earliest span). A trace's start is its earliest span, so one whose earlier span arrives late can appear again on a later page; the list removes the repeat.

Since 0.20.0 the list also finds the GenAI traces that make no run: OpenTelemetry GenAI spans with no weft run and no [derived run](https://weftgo.dev/docs/observe/other-languages/#derived-runs), such as a chat-only instrumentation or an agent whose root span has not arrived. When the database holds any from the last 7 days, the runs list says so beside its count (and on its empty state): `3 GenAI traces not runs in the last 7 days — why`, a link to `/traces?not_run=1&since=<7 days ago>`. There the filter is a chip, `GenAI traces that are not runs`, that clears it. The trace page of such a trace says why in its header, `not a run: <reason> · fix: <fix>`, from the API's `not_run` ([`GET /api/traces/{id}`](https://weftgo.dev/docs/reference/studio-api/#get-api-traces-id)).

### A trace page

`/traces/<trace id>` draws any trace as a span tree on a time axis: one row per span with its name (`invoke_agent director`, `chat script`, `execute_tool ops_manager`), its status, service and duration. Select a span for its attributes. The header names the root span, the service, when it started and whether it failed, and lists the trace's weft runs, each linking its run page.

![A trace page for a director that delegates to an ops-manager, which delegates again: the three runs it holds, and the span tree of invoke_agent, chat and execute_tool spans on a time axis](https://weftgo.dev/docs/_astro/studio-trace.light.CzQt7DKW.webp)

*A director's trace: the three weft runs it holds, and its invoke_agent, chat and execute_tool spans as a tree on a time axis.*

The **chat** view (`?view=chat`) draws each model call's messages, role by role, from the OpenTelemetry GenAI attributes: `gen_ai.input.messages`, `gen_ai.output.messages` and `gen_ai.system_instructions`, or the older `gen_ai.prompt` and `gen_ai.completion` keys. A model call that carries neither says `not_recorded`; weft's own chat spans carry no content (weft records it as log records), so for a weft run read the run page instead. A Python or TypeScript app's GenAI spans read here as they are ([Inspect agents written in other languages](https://weftgo.dev/docs/observe/other-languages/)).

Every selection is a URL: `?sel=` takes the same row keys as the run tree, so a link names the same row on the run page and here. `r:<run>` is an `invoke_agent` span, `s<step>:m` a chat span, `c:<step>:<call id>` a tool call, and other runs of the trace are run-qualified (`s:<run>:<step>:m`); `t:<span id>` names any other span (`t:<run>:<span id>` in a run-qualified key). The run page's scope switch, **this run** | **whole trace** (0.20.0), opens the trace with its selection kept, and names the run it came from in `?run=`. The trace page draws the same switch: its **this run** goes back to that run, else to the trace's root run, carrying the selection. On a playground run, an errored chat span offers **replay from this step**.

### Trace routes

`GET /api/traces` (capability `traces`) answers one row per trace: `trace_id`, `root` (`{span_id, name}`, or null with the `gap` badge), `service`, `start`, `end`, `duration_ms`, `span_count`, `error`, `run_ids`, `root_run` and `failed_runs`. It takes `since` and `until` (RFC 3339 only; the page's boxes also take a bare day and convert it), `service` and `public_id`, and pages by `before` and `before_id` with `limit` (50 by default, 500 at most). A panel token lists only the traces every span of which carries its public id. `GET /api/traces/{id}` is one trace's spans.

```sh
curl -s -H "Authorization: Bearer $TOKEN" \
  'http://127.0.0.1:7331/api/traces?service=checkout&since=2026-10-17T00:00:00Z&limit=20'
```

Both read [`obsdb.DB`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/obsdb#DB)'s `Traces` method, which both backends implement over their spans table.

## Best practices & gotchas

- **Title your sessions.** A session titled through `SetInfo` keeps its title on a content-off destination; an untitled one falls back to its first prompt, which content-off does not store. (Source: CHANGELOG.md:343; `studio/api.go:903-960`)
- **Create sessions with a public id when the panel or a hosted Studio will read them.** `GET /api/sessions/{id}/public_id` answers `not_recorded` (cause `no_public_id`) for a session whose turns carry none, and panel tokens are scoped by public id. (Source: CHANGELOG.md:2255)
- **A trace page is not a run page.** It shows spans; the transcript, events, the Request pane and the story are on the run page its run links open. (Source: `studio/README.md:2353-2396`)

## See also

- [Read a run in Studio](https://weftgo.dev/docs/observe/studio/run-page/)
- [What is a session?](https://weftgo.dev/docs/sessions/overview/)
- [Inspect agents written in other languages](https://weftgo.dev/docs/observe/other-languages/)
- [Studio HTTP API](https://weftgo.dev/docs/reference/studio-api/)

Symbols used: [`thread`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/thread) · [`obsdb.DB`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/obsdb#DB)
