Skip to main content

Module metrics

Module metrics 

Source
Available on crate feature serve only.
Expand description

faucet_serve_* request metrics. The path label is the matched route template (/v1/runs/{id}), never the raw path — cardinality safety.

Functions§

inc_run_logs_purged
Count persisted run-log lines purged by the retention loop (#529).
matched_path_label
The matched route template for a request, or <unmatched> for a 404.
record_idempotency_hit
Count an idempotency-key replay hit.
record_run_finished
Count a run reaching a terminal state, labelled by status + a finer reason.
record_runs_claimed
Count runs claimed by this instance’s claim loop.
record_runs_reclaimed
Count failover reclaims, split by outcome.
record_shards_claimed
Count source shards claimed for execution by this instance (Mode B, #230).
record_shards_reclaimed
Count shard reclaims (rebalance), split by outcome (Mode B, #230).
set_cluster_enabled
1 when clustered execution is enabled for this instance, else 0.
set_cluster_instances
Live cluster member count (refreshed each lease-loop tick).
set_history_degraded
Set the run-history degraded gauge (1 once the persistent backend has fallen back to in-memory; drives alerting alongside /readyz).
set_run_gauges
Refresh the queue-depth + in-flight gauges from the registry. Called on every queue transition (submit, queued→running, finish).
track_metrics
Middleware: count every request + record its duration, labelled by method, matched-path template, and response status.