@cybernetyx1/atlasflow-observability
v0.1.8
Published
JSON logging and in-process metrics observers for AtlasFlow event streams.
Readme
@cybernetyx1/atlasflow-observability
Lightweight JSON logging and in-process metrics observers for the AtlasFlow runtime event stream.
Install
npm install @cybernetyx1/atlasflow-observabilityPart of the AtlasFlow monorepo. Proprietary.
Usage
Subscribe an observer to the runtime event bus with observe(). createJsonLogObserver turns events into JSONL-friendly log records (with filtering and tool-argument redaction); createMetricsObserver aggregates run/turn/tool/error counts and token cost, exposing snapshot() and reset().
import { observe } from "@cybernetyx1/atlasflow-runtime";
import { createJsonLogObserver, createMetricsObserver } from "@cybernetyx1/atlasflow-observability";
observe(createJsonLogObserver());
const metrics = createMetricsObserver();
observe(metrics.observe);
// later
console.log(metrics.snapshot()); // { runsStarted, runsSucceeded, totalTokens, costTotal, byAgent, ... }In generated servers these are wired automatically: set ATLASFLOW_OBSERVABILITY=metrics (or all), or ATLASFLOW_METRICS=true, to enable the metrics observer and surface it on the authenticated /admin/metrics route.
Exports: createJsonLogObserver, createMetricsObserver, and the LogLevel / JsonLogRecord / JsonLogObserverOptions / AgentMetrics / ObservabilityMetrics / MetricsObserver types.
License
Proprietary. © 2026 Cybernetyx. See LICENSE.
