@reactive-agents/observe
v0.15.0
Published
OpenInference-compliant OpenTelemetry tracing for reactive-agents — maps AgentEvent stream to semantic spans
Maintainers
Readme
@reactive-agents/observe
OpenInference-compliant OpenTelemetry tracing for reactive-agents — maps AgentEvent stream to semantic spans
Zero-config OpenTelemetry tracing for AI agents. This package subscribes to the Reactive Agents EventBus and emits OpenInference-attributed spans (AGENT, LLM, TOOL) so your agent runs show up in any OTLP backend — Phoenix, Arize, Jaeger, Grafana Tempo, Honeycomb, and more. Drop-in LLM observability with model names, token counts, tool parameters, and inputs/outputs already on the spans.
Install
bun add @reactive-agents/observe
# or: npm install @reactive-agents/observeUsage
Wire the OTLP exporter once at process start, then provide the tracer layer to your agent runtime so events become spans.
import { setupOpenInferenceExporter, OpenInferenceTracerLayer } from "@reactive-agents/observe";
// 1. Start the exporter (sends spans over OTLP/HTTP).
const handle = setupOpenInferenceExporter({
serviceName: "my-agent",
endpoint: "http://localhost:4318", // defaults to OTEL_EXPORTER_OTLP_ENDPOINT
});
// 2. Provide OpenInferenceTracerLayer to your agent's Effect runtime
// (it subscribes to the EventBus and records AGENT / LLM / TOOL spans).
// ... run your agents ...
// 3. Flush + shut down before exit.
await handle.shutdown();Already exporting OTel elsewhere? Use autoConfigureExporter() — it's a no-op unless OTEL_EXPORTER_OTLP_ENDPOINT is set.
API
OpenInferenceTracerLayer— EffectLayerthat subscribes to theEventBusand emits OpenInference spans. RequiresEventBus.setupOpenInferenceExporter(config?)— register an OTLP/HTTP exporter and global tracer provider; returns anExporterHandle.autoConfigureExporter(config?)— set up the exporter only ifOTEL_EXPORTER_OTLP_ENDPOINTis present; otherwise a no-op handle.OpenInferenceExporterConfig—{ endpoint?, headers?, serviceName? }.ExporterHandle—{ shutdown(): Promise<void> }to flush and tear down.
Part of Reactive Agents
This package is part of Reactive Agents — the TypeScript AI agent framework built on Effect-TS. See the Observability docs and the full documentation.
