Skip to content

Observability

Enable the metrics endpoint:

[mothership]
metrics_port = 9090

Scrape http://127.0.0.1:9090/metrics:

mothership_ship_status{ship="app",group="web"} 1
mothership_ship_healthy{ship="app",group="web"} 1
mothership_ship_restarts_total{ship="app",group="web"} 0
mothership_ship_memory_rss_bytes{ship="app",group="web"} 52428800
mothership_ship_memory_virtual_bytes{ship="app",group="web"} 1073741824
mothership_requests_total{route="/api"} 1234
mothership_fleet_ships_total 3

The same port serves GET /health for liveness probes.

Per-ship RSS and virtual memory are sampled and exported as metrics on Linux, macOS, and FreeBSD.

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"}

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

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.