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::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.