CLI

Traces

Count, measure and export production traffic by its eval results: stats against the previous window, rows in the dataset export shape, runs with every span, or fine-tuning examples, without making a dataset.

Count

trodo traces count --kind runs --since 30d --agent support --eval "any:passed" --eval "any:not-failed"
{ "kind": "runs", "matched": 1046, "capped": false, "window": { "from": "...", "to": "..." }, "sample": [ ... ] }

Count before you pull. capped is true past 10,000.

What you can filter on

trodo traces agents --table              # agent names traces carry (what --agent takes), with run counts
trodo traces fields                      # the properties --where can name: run, span, custom, metadata
trodo traces values metadata.tier        # the values one takes, most common first

Stats

trodo traces stats --since 7d --agent support --compare

What the filter matches, in numbers: how many, errors and the error rate, latency p50 / p95 / p99, tokens, cost, people's thumbs and ratings, how many verdicts passed and failed, and the 20 busiest agents. --compare adds the window just before it (the last 7 days beside the 7 before) and the change in percent. --kind spans counts model calls instead of runs; conversations are counted over their runs.

A terminal running trodo traces stats over two weeks with --compare, piped through jq: runs, error rate, p95 latency, cost, eval passes and failures, and the change against the two weeks before.

Export

trodo traces export [filters] [--include-trace] [--format trodo|openai|dpo] [--target output|expected|expected-else-output] [-o file]

Without --format, a line is the row a dataset would hold, in the export shape: input, output, expected, evaluations (every verdict, its path through the eval and any correction), metadata and source (the run, span and conversation ids). --include-trace adds trace to run rows:

"trace": {
  "span_count": 16, "truncated": false,
  "spans": [
    { "span_id": "...", "parent_span_id": null, "kind": "agent", "name": "kyc_verifier", "status": "ok",
      "input": ..., "output": ..., "started_at": "...", "duration_ms": 25209 },
    { "span_id": "...", "parent_span_id": "...", "kind": "llm", "model": "gpt-5.4-mini",
      "tokens": { "input": 812, "output": 96 }, "cost": 0.0011, ... }
  ]
}

Spans are in start order, so a parent comes before its children and the tree rebuilds in one pass from parent_span_id. At most 1,000 spans per run.

--dir DIR writes one pretty JSON file per unit instead of one stream: run-<id>.json, span-<id>.json, conversation-<id>.json, verdict-<id>.json. That is the shape to hand a coding agent to read one trace at a time.

--limit defaults to 1,000 and stops at 50,000. The last line of the stream is a summary object, {"_trodo": {"rows": ...}}; with -o it is printed to the terminal instead.

Fine-tuning formats

--formatA line is
openai{"messages": [...input, assistant]}, OpenAI's chat fine-tuning format. Fireworks and Together take it unchanged (fireworks and together are accepted as names for it).
dpo{"input": {"messages"}, "preferred_output": [Expected], "non_preferred_output": [Output]}, only rows that have both and where they differ

--target picks the assistant turn: output (what the model said: the choice for traffic that passed its evals), expected, or expected-else-output (the default). Tool calls keep OpenAI's shape. Roles fine-tuning does not take (a logged context turn) become system messages. A row with no input or no target is skipped and counted.

trodo traces export --kind spans --since 30d --eval any:passed --eval any:not-failed \
  --format openai --target output -o sft.jsonl

On this page