@zanii/otel
v0.1.0
Published
Surface every agent action as an OpenTelemetry span - Zanii proofs show up in the observability stack you already run (Datadog, Honeycomb, Grafana).
Readme
@zanii/otel
Surface every agent action as an OpenTelemetry span, so Zanii proofs show up
in the observability stack you already run — Datadog, Honeycomb, Grafana Tempo,
Jaeger. Wrap the agent once; each record / recordPayment becomes a span
carrying zanii.target, zanii.action, and the receipt zanii.hash.
npm install @zanii/otel @opentelemetry/apiDepends only on @opentelemetry/api (peer) — your own OTel SDK does the exporting.
Usage
import { withTracing } from '@zanii/otel';
import { ZaniiAgent } from '@zanii/sdk';
const agent = withTracing(new ZaniiAgent({ /* … */ }));
// nothing else changes — this call is now a span in your traces:
await agent.record({ target: 'crm.lookup', payload: { id: 42 } });Successful records set span status OK and attach the proof hash; failures
record the exception, set status ERROR, and rethrow. All other agent methods
pass through untouched. Pass { tracer } to use a specific tracer instead of the
global one.
Changelog
- 0.1.0 — initial release:
withTracing.
License
Apache-2.0.
