Skip to Content
CLI & APICommand reference

stackblaze metrics

Show CPU/memory usage for an app (now, or history with --since)

Usage: stackblaze metrics [options]

Show CPU/memory usage for an app (now, or history with --since)

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  --since <window>       History window: 30m, 1h, 24h, 7d (max 7d) — sparklines
                         for cpu, memory, requests, latency
  -w, --watch            Refresh the history until Ctrl-C (default window 1h)
                         (default: false)
  --interval <seconds>   Seconds between --watch refreshes (default 30)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Without --since: the current CPU/memory of each pod. With --since: history
over the window, all pods combined, as a sparkline with now / avg / max.
--json prints the raw series (timestamps in ms); --watch --json prints one
document per refresh (NDJSON).

Examples:
  stackblaze metrics --since 24h
  stackblaze metrics --since 1h --watch
  stackblaze metrics --since 7d --json

Example

Show each pod's CPU and memory now, then the last 24 hours as sparklines.

stackblaze metrics -p github-demo-gv35 -e dev -a nginx
stackblaze metrics -p github-demo-gv35 -e dev -a nginx --since 24h
OK github-demo-gv35/dev/nginx-9agm
  nginx-9agm-web-78d78c7586-bhm6w  cpu: 0m  mem: 6Mi
OK github-demo-gv35/dev/nginx-9agm — last 24h
  cpu       ▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁  now 0m  avg 0m  max 8m
  memory    ▁▁▁█▃▁▁▁▁▁▁▁▁▁▁▃▁▁▃▁▃▁▁▁▁▁▃▁▁▃▁▁▁▁▁▁▁▃▁▁  now 6.5MB  avg 7.0MB  max 19.4MB
  requests  ▆▅█▁▄▆▇▆▆▆▆▆▆▆▆▆█▅▅▆▅▆▆▆▆▆▆▆▅▆▆▆▆▆▅▆▅▆▆▅  now 0.43/s  avg 0.43/s  max 0.51/s
  latency   ▃▃▃▃▃▄▅▃█▅█▆▄▆█▆▂▂▄▂▃▅▄▃▅▄▃▁▁▃▃▃▃▄▁▁▁▂▂▃  now 0.1ms  avg 0.1ms  max 0.2ms

On this page