Observability
How Agentronics records detection, auth, policy, memory, and tool traces.
Observability
The SDK records a trace for every governance decision it makes — detections, identities, authorization decisions and reviews, tool registrations and calls, memory access. Traces stay in an in-memory buffer until you export them. Sent to the Agentronics console, they power the Observability page (agent sessions, filters, error rate, p50/p95 tool latency) and every pillar page.
Trace shape
Every trace has stable routing fields plus optional context for the pillar that produced it.
Event types: detection (agent.detected, agent.missed), identity (auth.identity_presented, auth.identity_cleared), authorization (authz.evaluated — reviews carry metadata.review and approved), tools (tool.registered, tool.surfaced, tool.executed, tool.progressed), memory (memory.accessed, memory.updated) and sdk.error. sessionId groups one agent's events into a session.
Reading local traces
The in-memory buffer keeps the newest 500 events by default. Set trace.bufferSize to tune that.
Sending traces to the console
The console's ingest key is a secret, so the browser can't send traces directly. Point the browser at a route on your own site, and relay from there:
The relay drops unknown event types, caps each batch at 100 events, and always answers 202 quickly — a console outage never breaks your page. The webhook exporter retries with backoff and queues failed batches in browser storage.
Server-side traces (e.g. from the auth middleware) go straight to the console with createDashboardExporter({ url, ingestKey }) — see Connect to the console.
Without a server route: trace: { gateway: true } sends traces straight from the browser to the Agentronics API with your publishable key. The key must list the page's origin (console → Settings → Publishable keys); calls from other origins are refused, and each key is rate-limited.
Other exporters: debug: true adds a console exporter; trace.exporters takes your own { name, export(events) }; traceRate / errorRate sample. To keep a copy of everything, pass forward to the relay — see Data export.
PII scrub
Trace metadata is scrubbed before it enters the buffer or exporters. Defaults redact metadata.password, metadata.token, metadata.authorization, and metadata.cookie.
Scrubbing uses dot paths over JSON-serializable metadata. Keep raw secrets out of trace metadata whenever possible; scrubbers are a second line of defense.