build

Add observability

Trace Reference-agent runs, streams, resumptions, and subscriptions by their durable identities.

SDKintermediate0.7.0 Stable
Verified 2026-07-20View sourceReport a docs issue

Install

Bash
pnpm add @kestrel-agents/observability@0.7.0 @kestrel-agents/sdk@0.7.0

Create a tracer and wrap the agent

TypeScript
import {
  createTracer,
  InMemoryTraceProcessor,
} from "@kestrel-agents/observability";
 
const tracer = createTracer({
  processors: [new InMemoryTraceProcessor()],
});
 
const tracedAgent = tracer.wrapAgent(agent);

The wrapper instruments run(), stream(), resume(), and subscribe() while preserving their SDK contracts. Traces carry the Kestrel identities needed to connect a request with its session, run, actor, tenant, and terminal outcome.

OpenTelemetry export

Kestrel's trace model can be exported through the package's OpenTelemetry bridge:

TypeScript
import { OpenTelemetryTraceExporter } from "@kestrel-agents/observability";
 
const exporter = new OpenTelemetryTraceExporter();

The export layer does not replace Kestrel's durable run events or terminal results. It makes the same operation easier to find in an external tracing system.

Read the Observability reference and Reliability guide next.