agentskit.js
Observability

Observability

Attach loggers, tracers, and cost guards to any runtime — no code changes beyond adding an observer.

Agents fail in ways that are hard to reproduce: the model chose a wrong tool, a retrieval returned stale data, a run silently blew past its budget. Observability gives you a structured record of every LLM call, tool execution, and agent step so you can answer "what happened and why" without guessing.

#Loggers + tracers

  • consoleLogger — local dev.
  • langsmith — LangSmith observer.
  • opentelemetry — OTel observer.
  • langfuse — Langfuse observer (@agentskit/observability-langfuse).
  • createTraceTracker — low-level span lifecycle.

#Local trace viewer

  • createFileTraceSink + renderTraceViewerHtml — offline Jaeger-style HTML. Recipe.

#Devtools server

  • createDevtoolsServer + toSseFrame — live feed for any devtools UI. Recipe.

#Cost + tokens

  • costGuard — hard $ ceiling per run.
  • approximateCounter, createProviderCounter — token accounting.

#Audit

  • createSignedAuditLog — hash-chain + HMAC tamper-evident log. Recipe.

Explore nearby

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

On this page