Skip to main content

crewship metrics

Fetch mission performance metrics or pull a metric timeseries. Without flags, returns the mission summary — success rate, p50/p99 durations, total runs over the last default window. With --series <name>, switches to a timeseries endpoint and returns time-bucketed points.
crewship metrics [flags]
Requires an authenticated session and a selected workspace (requireAuthAndWorkspace). The output is always structured JSON (or YAML with --format yaml). Pipe through jq or use --filter for ad-hoc shapes — there is no canonical table form for the records returned.

Flags

FlagDefaultPurpose
--series <name>""Fetch a timeseries for the named metric instead of the mission summary. Routes to /api/v1/metrics/timeseries.
--range <window>24hWindow for --series1h, 24h, 7d are the supported sugar values.
--filter <jq-expr>""Pipe JSON output through jq <expr> (requires jq in $PATH).
The global --format flag (table / json / yaml / ndjson / quiet) is honoured. The default is indented JSON because the data here is structured records without a single canonical “table” shape.

Endpoints

ModeEndpoint
DefaultGET /api/v1/mission-metrics
--series <name>GET /api/v1/metrics/timeseries?metric=<name>&range=<window>

Examples

Mission summary

crewship metrics
# {
#   "total_runs": 142,
#   "success_rate": 0.93,
#   "duration_p50_ms": 4280,
#   "duration_p99_ms": 28150,
#   "cost_usd_total": 2.84
# }

Active-runs timeseries over the last hour

crewship metrics --series active_runs --range 1h

Week-long window

crewship metrics --series active_runs --range 7d

Pull a single field via jq

crewship metrics --filter '.success_rate'

YAML output

crewship metrics --format yaml

Pipe to a chart

crewship metrics --series active_runs --range 24h --format json \
  | jq -r '.points[] | "\(.ts) \(.value)"' \
  | gnuplot -p -e "plot '<cat' using 1:2 with lines"

See also