Open Agent Loops
API Reference

TracerOptions

@open-agent-loops/core


Defined in: observability/tracer.ts:44

Properties

PropertyTypeDescriptionDefined in
flushOnEnd?booleanAuto-drain the async write queue when the run ends (on the agent_end event). The loop awaits that event, so runAgent resolves only once the trace is fully written — you never have to call flush() yourself. Default true; set false to manage draining manually (e.g. a writer reused across runs). No effect without write.observability/tracer.ts:70
limit?numberKeep at most this many entries (ring buffer). Default: unbounded.observability/tracer.ts:72
log?(line) => voidSynchronous live JSON logging: called with JSON.stringify(entry) inline as each entry is recorded. Use for cheap sinks (an array, console.log). For file/network I/O prefer write (async, batched, off the hot path).observability/tracer.ts:54
meta?TraceMetaSeed run metadata (model, params, system, ...) up front.observability/tracer.ts:74
now?() => numberClock, injectable for deterministic tests. Defaults to Date.now.observability/tracer.ts:46
onEntry?(entry) => voidCalled with each entry as it's recorded — e.g. to live-print a trace.observability/tracer.ts:48
write?(lines) => void | Promise<void>Async batched JSON logging: receives compact JSON lines in batches, off the agent loop's hot path (fire-and-forget, queued). Wire to a file/socket, e.g. { write: (lines) => appendFile("trace.jsonl", lines.join("\n") + "\n") }. Call await tracer.flush() at run end so the tail isn't lost.observability/tracer.ts:61
writerOptions?AsyncWriterOptionsTuning for the async write queue (batch size, backpressure threshold).observability/tracer.ts:63

On this page