Skip to main content

Crate machi_obs

Crate machi_obs 

Source
Expand description

Observability spine for the Machi kernel.

  • Stable metric series names and record helpers (metrics)
  • Re-export of span / field catalogue from machi_protocol
  • Redaction helpers so hosts never log secrets by accident

Production hosts inject a real MetricsSink (Prometheus / OTEL adapters live behind optional features in later phases). The kernel only depends on the trait surface.

Re-exports§

pub use metrics::METRIC_COMPACTIONS_TOTAL;
pub use metrics::METRIC_SAMPLE_DURATION_MS;
pub use metrics::METRIC_SPAWNS_TOTAL;
pub use metrics::METRIC_TOKENS_TOTAL;
pub use metrics::METRIC_TOOL_CALLS_TOTAL;
pub use metrics::METRIC_TOOL_DURATION_MS;
pub use metrics::METRIC_TURN_DURATION_MS;
pub use metrics::METRIC_TURN_STEPS;
pub use metrics::METRIC_TURNS_TOTAL;
pub use metrics::METRIC_WORKFLOW_AGENTS_TOTAL;
pub use metrics::METRIC_WORKFLOW_RUNS_TOTAL;
pub use metrics::MetricsSink;
pub use metrics::NoopMetrics;
pub use metrics::SharedMetrics;
pub use metrics::emit_catalogue_smoke;
pub use metrics::metric_catalogue_snapshot;
pub use metrics::record_compaction;
pub use metrics::record_sample;
pub use metrics::record_spawn;
pub use metrics::record_tool_call;
pub use metrics::record_turn;
pub use metrics::record_workflow_agents;
pub use metrics::record_workflow_run;
pub use metrics::required_metric_names;
pub use prometheus::PrometheusRecorder;
pub use recording::CounterEvent;
pub use recording::GaugeEvent;
pub use recording::HistogramEvent;
pub use recording::RecordingMetrics;
pub use redact::REDACTED;
pub use redact::looks_like_secret_key;
pub use redact::redact_key_value;
pub use redact::redact_map;

Modules§

field
Canonical field names (string constants for hosts and tests).
metrics
Stable metric series and a host-injected sink.
prometheus
Prometheus text exposition for captured metrics (zero external deps).
recording
In-memory metrics capture for tests and local debugging.
redact
Log / telemetry field redaction.

Constants§

SPAN_COMPACT
Compaction pass.
SPAN_SAMPLE
One LLM sample call.
SPAN_SESSION
Session lifetime span.
SPAN_SPAWN
Nested agent spawn.
SPAN_TOOL
One tool execution.
SPAN_TOOL_BATCH
Dispatched tool batch.
SPAN_TURN
Single turn span.
SPAN_WORKFLOW
Workflow run.
SPAN_WORKFLOW_HOST
One workflow host request.

Functions§

required_span_names
All required span names (contract test surface).
span_catalogue_snapshot
Exact newline-joined span catalogue for CI golden comparison.