BIU UI/Blocks/Run Inspector
Live ScreenTrace WaterfallToken & Cost Telemetry

Run Inspector

Observability workbench for inspecting single AI agent runs — featuring a collapsible span tree, aligned millisecond waterfall, copyable Input/Output payloads, failure diagnostics, and token/cost attribution.

ProRun Inspector is a BIU UI Pro block — interactive preview is open; @biudev-pro/run-inspector Registry access coming soon.
MIT open-source core available today
packages/ui/src/components/run-inspector.tsx

Q3 edge caching audit

Succeededclaude-sonnet-4
run_01J9X402·10:41:12 AM·production
Total duration3.42s7 spans traced
Total tokens64.2K48.6K in · 15.6K out
Estimated cost$0.18221.4K cached
Tools & errors2 tools · 0 errAll checks passed
Span treeDur
3.42s
780ms
460ms
590ms
310ms
1.32s
220ms
LLMplanner.reasonok
40ms → 820ms·780ms·$0.041

Select telemetry + egress tools

Input
{
  "system": "Plan minimal tool calls to verify Q3 metrics.",
  "messages": 2
}
Output
{
  "toolCalls": [
    "query_metrics",
    "read_sheet"
  ]
}

When to use

Good fit

Agent observability consoles, eval & debugging views, and developer platforms where engineers inspect latency bottlenecks, failing tool calls, and token/cost attribution per span.

When not to use

End-user chat interfaces — keep lightweight reasoning and tool summaries inline with Thinking State and Tool Call Card.

Key capabilities

Hierarchical step tree + proportional waterfall

Every nested Agent, LLM, Tool, Retrieval, and Guardrail span aligns to a shared millisecond ruler with collapsible branches and instant kind/error/text filtering.

Payload, token & cost attribution inspector

Click any span bar to inspect copyable JSON Input / Output, structured error callouts, latency percentage share, prompt/completion/cached token breakdown, and OTel-style metadata.

Failure triage & one-click trace replay

Switch to the failed Staging DB migration run to jump straight to the failing shell.exec span (ERROR 55P03), copy the full trace JSON, or click Replay run to simulate a clean rerun.

Zero external charting dependencies

Pure CSS geometry and BIU UI primitives (AppShellFlat, ResizablePanelGroup, Tabs, ScrollArea, Badge, Button) — lightweight, theme-aware, and copy-pasteable via Registry.

API Reference

Feed OpenTelemetry or custom agent traces into runs and handle onSelectSpan / onReplayRun to connect replay or deep-link routing.

RunInspectorProps

PropTypeDefaultDescription
layout'flat' | 'inset''flat'Shell geometry passed to AppShellFlat (flat edge-to-edge hairlines or inset framed cards).
workspacestring'Trace Studio'Workspace title displayed in the left sidebar header.
userAppShellUser{ name, email }Signed-in operator rendered in the sidebar footer.
runsreadonly AgentTraceRun[]DEFAULT_RUN_INSPECTOR_RUNSCurrent snapshot of traced agent runs. Pass a new array to update the sidebar and trace while the inspector is mounted.
defaultRunIdstring'run_01J9X402'Initially selected run ID.
onSelectSpan(runId, span) => void—Callback fired when a span row or waterfall bar is selected.
onReplayRun(run) => void—Callback fired when the user clicks Replay run in the header.

TraceSpan

FieldTypeDefaultDescription
id / parentId / namestring—Span identifier, optional parent span ID for tree nesting, and display name.
kind / statusTraceSpanKind / TraceSpanStatus—Span category (agent, llm, tool, retrieval, guardrail) and status (ok, error, running).
startMs / durationMsnumber—Timeline offset and duration in milliseconds used to position the waterfall bar.
inputTokens / outputTokens / cachedTokens / costUsdnumber—Optional LLM token usage and cost attribution rendered in the Metrics tab.
input / output / error / attributesunknown / string / Record—Structured JSON payloads, error message banner, and key-value trace attributes.

Included Primitives

Installing run-inspector automatically pulls these BIU UI primitives through the shadcn Registry: