Skip to content
pandacoderz/ui

Trace Viewer

Span waterfall for one request with tokens, latency, and input and output payloads.

Open in new tab ↗

What’s inside

  • Trace list with status, model, and latency.
  • Waterfall positions each span by start and duration, coloured by kind and nested by depth.
  • Span detail shows tokens plus input and output as highlighted JSON via Code Block.

Installation

npx shadcn@latest add https://ui.spencerwueste.com/r/trace-viewer.json

The registry item pulls in every component it depends on.

Usage

import TraceViewer from "@/components/blocks/trace-viewer/trace-viewer";

export default function Page() {
  return (
    <div className="h-dvh p-4">
      <TraceViewer />
    </div>
  );
}

Give the parent a bounded height. The block fills it and scrolls internally.

Going live

Map your tracing backend’s spans onto the Span shape: start offset, duration, depth, kind, and payloads. OpenTelemetry-style parent ids convert to depth with a single pass.