Concepts
Runs, spans, conversations and users: what each one is in Trodo, which IDs tie them together, and what is added up for you.
Runs and spans
One execution of your agent is a run: one wrapAgent call, one request answered, one job done. Every step inside it is a span, and spans nest under the run and under each other. The run plus its span tree is the trace:
A run has a name (the agent's name), an input, an output and a status. You set those; everything else on the run is added up from its spans.
A span's kind decides what it shows and what it adds to the run:
| Kind | For | Adds to the run |
|---|---|---|
llm | A model call | Tokens and cost |
tool | A function the agent calls | Tool count |
retrieval | A vector search or document lookup | |
agent | A sub-agent or a stage of the run | |
generic | Any other step you want timed |
Model calls from supported SDKs and frameworks become llm spans on their own. You add the rest with manual spans.
What is added up
| On the run | Comes from |
|---|---|
| Tokens in and out | Every llm span under the run |
| Cost | Each llm span's model and tokens, priced by Model prices |
| Duration | The run's start and end; each span keeps its own |
| Spans, tools, errors | Counts of the spans under the run, and of those that failed (Status & errors) |
So the run's totals always match the spans that explain them.
Users and conversations
Two IDs you pass on the wrap turn a stream of runs into something you can read per person and per chat:
distinctIdis the user the run was for. It joins runs to the user's profile, filters, and the Users page. Without it, each run's user is an anonymous id. See Users.conversationIdgroups the runs of one multi-turn chat or thread. Each turn is still its own run with its own trace; the conversation stacks them in order. Conversation-level evals score the whole thread. See Conversations.
Where you see them
Traces has three views, from widest to narrowest: Conversations, Runs and Spans. Each conversation holds runs, and each run holds spans. Open any row to see its trace.

Run IDs
Every run has a run ID, a UUID. wrapAgent returns it (Python: run.run_id); use it to send feedback, to find the run in Traces, or to log next to your own request IDs.
const { result, runId } = await trodo.wrapAgent('support-agent', async (run) => { /* ... */ });with trodo.wrap_agent("support-agent") as run:
...
run_id = run.run_idTo give a run an ID of your own, for example so a job's ID finds its trace, pass runId to startRun. It must be a UUID. Turn your own ID into one that is always the same for the same job:
import { v5 as uuidv5 } from 'uuid';
const runId = uuidv5(`job:${job.id}`, uuidv5.URL);
await trodo.startRun('nightly-ingest', { runId });import uuid
run_id = str(uuid.uuid5(uuid.NAMESPACE_URL, f"job:{job.id}"))
trodo.start_run("nightly-ingest", run_id=run_id)When a run crosses services, its ID travels on a header and downstream spans join the same run. See Distributed tracing.