Files
ruflo/plugins/ruflo-observability/README.md
T
ReuvenandRuFlo 1c3093d464 fix(ruflo-observability): v0.2.0 — namespace-routing fix + adopt plugin contract (ADR-0001)
Same bug class as cost-tracker / market-data / migrations: both skills
called agentdb_hierarchical-recall with namespace argument "observability"
— that tool family routes by tier, ignores namespace. Skills were
silently reading nothing.

Functional fixes:
- observe-trace: switch span-collection from agentdb_hierarchical-recall
  to memory_search/_list (namespace-routed)
- observe-metrics: switch metric-retrieval to memory_*; document dual
  pattern-store path (ReasoningBank-typed vs memory_store --namespace
  observability)

Contract additions:
- ADR-0001 (Proposed) at docs/adrs/0001-observability-contract.md
- README adds Compatibility (pin v3.6), Namespace coordination (claims
  observability as base-name exception, cf. federation/migrations;
  routing-note callout), Verification + Architecture Decisions
- plugin.json bumps 0.1.0 → 0.2.0; keywords add mcp, distributed-tracing,
  anomaly-detection
- scripts/smoke.sh — 10 structural checks: version + keywords, both
  skills + agent + command present, both skills use memory_* not
  hierarchical-* with namespace, dual pattern-store doc'd, 5 subcommands,
  v3.6 pin, namespace coordination, ADR Proposed, no wildcard tools

Verification: bash plugins/ruflo-observability/scripts/smoke.sh → 10/10

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-04 20:25:51 -04:00

3.9 KiB

ruflo-observability

Structured logging, distributed tracing, and metrics -- correlate agent swarm activity with application telemetry.

Overview

Implements OpenTelemetry-compatible structured logging with correlation IDs, distributed tracing with parent-child span hierarchies, and metrics collection (counters, gauges, histograms). Correlates swarm agent activity with application-level telemetry and detects anomalies in latency, error rates, and resource usage.

Installation

claude --plugin-dir plugins/ruflo-observability

Agents

Agent Model Role
observability-engineer sonnet Structured logging, distributed tracing, metrics collection, agent-application telemetry correlation

Skills

Skill Usage Description
observe-trace /observe-trace <task-id> Trace agent execution by collecting spans and building a trace tree
observe-metrics /observe-metrics [--period 1h] Aggregate and display system metrics with anomaly detection

Commands (5 subcommands)

observe trace <task-id>              # Trace agent execution with span tree
observe metrics [--period 1h]        # View aggregated metrics (p50, p95, p99)
observe logs [--level error]         # Filter structured logs by level
observe dashboard                    # Combined health dashboard
observe correlate <agent-id>         # Correlate all telemetry for an agent

Key Metrics

Metric Type Description
agent_task_duration_seconds Histogram Time to complete agent tasks
agent_token_usage Counter Tokens consumed per agent/model
agent_active_count Gauge Currently active agents
agent_error_rate Counter Errors per agent
swarm_span_duration_ms Histogram Span durations for tracing
memory_operations_total Counter AgentDB read/write counts

Trace Hierarchy

[root] swarm-task
  [child] agent-spawn (agent=architect)
  [child] agent-spawn (agent=coder)
    [child] file-read (path=src/auth.ts)
    [child] file-write (path=src/auth.ts)
  [child] agent-spawn (agent=tester)
    [child] test-run (suite=auth)

Log Format

JSON structured logs with timestamp, level, message, correlationId, agentId, taskId, spanId, traceId, duration_ms, and metadata.

Compatibility

  • CLI: pinned to @claude-flow/cli v3.6 major+minor.
  • Verification: bash plugins/ruflo-observability/scripts/smoke.sh is the contract.

Namespace coordination

This plugin owns the observability AgentDB namespace (base-name exception per ruflo-agentdb ADR-0001 §"Namespace convention", same precedent as federation and migrations). Reserved namespaces (pattern, claude-memories, default) MUST NOT be shadowed.

observability is accessed via memory_* tools (namespace-routed). Stores spans, metric snapshots, and log entries.

Routing note: Earlier versions of these skills used agentdb_hierarchical-recall with namespace argument — that tool family routes by tier and ignores namespace strings. ADR-0001 fixed the skills to use memory_* for namespaced reads and documented the dual pattern-store path for metric snapshots.

Verification

bash plugins/ruflo-observability/scripts/smoke.sh
# Expected: "10 passed, 0 failed"

Architecture Decisions

  • ruflo-agentdb — namespace convention owner; defines the routing rules ADR-0001 fixes a violation of
  • ruflo-cost-tracker -- Token usage metrics feed into cost attribution
  • ruflo-iot-cognitum -- Reuses Z-score anomaly detection for telemetry patterns
  • ruflo-market-data -- Data feed health and ingestion latency monitoring

License

MIT