agentskit.js
Packages

@agentskit/observability

Trace viewer, signed audit log, cost guard, devtools, token counters.

@agentskit/observability is the package you add when you no longer want to guess what your agent did. It turns opaque runs into inspectable traces, costs, audit events, and live debugging streams.

#When to reach for it

  • You need console / LangSmith / OpenTelemetry logging.
  • You want an offline HTML trace viewer.
  • You want a hard dollar ceiling (costGuard).
  • You want a tamper-evident audit log (SOC 2 / HIPAA friendly).
  • You want a live devtools feed (browser extension compatible).

#Best fit

  • Add this before opening an agent to real users or production workloads.
  • Pair with @agentskit/runtime to trace multi-step behavior.
  • Pair with @agentskit/eval when you want to turn failures into repeatable quality work.
  • Pair with @agentskit/security concepts when the workflow has compliance or audit requirements.

#Install

npm install @agentskit/observability

#Hello world

import { consoleLogger, costGuard } from '@agentskit/observability'
import { createRuntime } from '@agentskit/runtime'

const runtime = createRuntime({
  adapter,
  observers: [consoleLogger(), costGuard({ maxUsd: 0.5 })],
})

For many teams, this is the point where an agent stops feeling magical and starts feeling operable.

#Surface

  • Loggers: consoleLogger · langsmith · opentelemetry.
  • Tracing: createTraceTracker · createFileTraceSink · buildTraceReport · renderTraceViewerHtml.
  • Cost + tokens: costGuard · priceFor · computeCost · DEFAULT_PRICES · approximateCounter · countTokens · countTokensDetailed · createProviderCounter.
  • Audit: createSignedAuditLog · createInMemoryAuditStore.
  • Devtools: createDevtoolsServer · toSseFrame.

#Recipes

#Stability

  • Version: 0.5.1
  • Tier: beta
  • Contract: evolving
  • Roadmap: see packages roadmap for what this package needs to reach v1.0.

#Source

npm: @agentskit/observability · repo: packages/observability

Explore nearby

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

On this page