|Docs

railway metrics

View resource and HTTP metrics for a Railway service from the CLI. The metrics command works at three levels: the linked service by default, a specific service with --service, and every service in the project with --all.

You can also call the command as railway metric. Both forms behave identically.

Usage

Options

FlagDescription
-s, --service <SERVICE>Service to view metrics for. Defaults to the linked service. Conflicts with --all.
-a, --allShow metrics for all services in the project. Conflicts with --raw.
-e, --environment <ENV>Environment to view metrics for. Defaults to the linked environment.
-S, --since <TIME>Start of the time window. Accepts relative (1h, 6h, 1d, 7d) or ISO 8601. Defaults to 1h.
-U, --until <TIME>End of the time window. Same formats as --since. Defaults to now. Conflicts with --watch.
--cpuShow only CPU metrics.
--memoryShow only memory metrics.
--networkShow only public network traffic (egress and ingress).
--volumeShow only volume and disk metrics.
--httpShow only HTTP metrics.
--method <METHOD>Filter HTTP metrics by request method. Requires --http.
--path <PATH>Filter HTTP metrics by request path. Requires --http.
--rawOutput raw time-series data points instead of summaries.
--jsonOutput in JSON format.
-w, --watchOpen a live TUI dashboard that refreshes metrics.

Metric groups

When no metric flag is set, railway metrics shows every group. Pass one or more flags to limit output:

  • --cpu: CPU usage and limits.
  • --memory: Memory usage and limits.
  • --network: Public network ingress and egress.
  • --volume: Disk and volume usage.
  • --http: HTTP request totals, status-code buckets, error rate, and latency percentiles.

For database services, the command detects supported database images and includes native database stats from Postgres, Redis, MySQL, and MongoDB through Railway SSH.

Examples

Quick overview of the linked service

Specific service and environment

Last 6 hours

Specific time window

Only CPU and memory

Only HTTP metrics

HTTP metrics for POST requests to a specific path

Raw time-series data

Compact view across every service in the project

JSON output for scripts and agents

Live dashboard

The --watch mode opens an interactive TUI with periodic refreshes, time-range switching, metric toggles, HTTP status and latency series toggles, and per-service detail panels in project mode.