Observability
Prometheus metrics
Section titled “Prometheus metrics”Enable the metrics endpoint:
[mothership]metrics_port = 9090Scrape http://127.0.0.1:9090/metrics:
mothership_ship_status{ship="app",group="web"} 1mothership_ship_healthy{ship="app",group="web"} 1mothership_ship_restarts_total{ship="app",group="web"} 0mothership_ship_memory_rss_bytes{ship="app",group="web"} 52428800mothership_ship_memory_virtual_bytes{ship="app",group="web"} 1073741824mothership_requests_total{route="/api"} 1234mothership_fleet_ships_total 3The same port serves GET /health for liveness probes.
Memory monitoring
Section titled “Memory monitoring”Per-ship RSS and virtual memory are sampled and exported as metrics on Linux, macOS, and FreeBSD.
Lifecycle states
Section titled “Lifecycle states”Mothership tracks its lifecycle through an explicit state machine:
Initializing → Preflight → Electing → Prelaunch → Docking → Launching → Running → Draining → Landed ↓ ↓ ↓ ↓ ↓ ↓ Failed Failed Failed Failed Failed Crashed| State | Description |
|---|---|
Initializing |
Loading the manifest |
Preflight |
Verifying uplinks |
Electing |
Flagship coordination |
Prelaunch |
Running prelaunch jobs |
Docking |
Bays connecting |
Launching |
Ships starting |
Running |
Normal operation |
Mayday |
Distress mode (attempting recovery) |
Draining |
Graceful shutdown in progress |
Landed |
Clean exit |
Failed |
Startup failure |
Crashed |
Runtime failure |
The final status is logged on shutdown:
{"message":"Mothership landed","status":"landed"}Request logging & shields
Section titled “Request logging & shields”Requests are logged with the User-Agent classification and Ja4H fingerprint (see Routing → Shields):
DEBUG method=GET path=/ ua_kind=Chromium shields=Some("ge11nn06enus_...")Log verbosity follows RUST_LOG (e.g. RUST_LOG=info mothership).
TUI dashboard
Section titled “TUI dashboard”For interactive monitoring, run with --tui (requires the tui Cargo feature) — real-time ship status, per-process logs, and WASM module state. See the CLI reference.