agentskit.js
Observability

Trace viewer

Generate a self-contained HTML trace file from any run — inspect spans offline without a tracing backend.

When you need to debug a specific run without shipping to LangSmith or standing up a Jaeger instance, createFileTraceSink records spans to a local JSONL file and renderTraceViewerHtml turns that file into a standalone HTML page you can open in any browser.

import { createFileTraceSink, renderTraceViewerHtml } from '@agentskit/observability'

const sink = createFileTraceSink({ path: '.agentskit/traces.jsonl' })

const runtime = createRuntime({ adapter, observers: [sink.observer] })
await runtime.run(task)

const html = await renderTraceViewerHtml({ source: '.agentskit/traces.jsonl' })
await Bun.write('.agentskit/trace.html', html)

Open the generated file in any browser. Zero server. Zero tracking.

Explore nearby

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page