Skip to content

Add railway metrics command with interactive TUI#775

Open
rubenszinho wants to merge 3 commits intorailwayapp:masterfrom
rubenszinho:rubenszinho/metrics-command
Open

Add railway metrics command with interactive TUI#775
rubenszinho wants to merge 3 commits intorailwayapp:masterfrom
rubenszinho:rubenszinho/metrics-command

Conversation

@rubenszinho
Copy link

Closes #242

Adds a new railway metrics command to view service resource usage (CPU, Memory, Network) with both static table and live TUI modes.

New Command

  • railway metrics - Display resource metrics for all services.
  • --service <name> - Filter by specific service.
  • --time <1h|6h|12h|1d|3d|7d> - Historical time range (default: 1h).
  • --raw - JSON output for scripting.
  • --watch / -w - Live-updating TUI mode.

Features

  • Alphabetical service ordering
  • Live updates every 5 seconds.
  • Keyboard navigation (/, Tab, q to quit).
  • Sparkline charts with units (%, GB, MB).
  • Error display in header when API calls fail.
  • Color-coded CPU usage and human-readable units.

Development Environment

Updated Nix configuration to support newer Cargo features:

  • Added rustup to flake.nix and shell.nix.
  • Required for edition2024 feature used by dependencies.
  • Fixes compatibility with newer crate versions.

cargo run -- metrics --watch
image

cargo run -- metrics
image

cargo run -- metrics --time 6h
image

cargo run -- metrics --raw
image

@brody192 brody192 added the release/minor Author minor release label Jan 26, 2026
@brody192 brody192 requested a review from Milo123459 January 26, 2026 22:50
@coffee-cup
Copy link
Contributor

Can you make the --raw flag be --json instead so that it is inline with the other flags

@rubenszinho
Copy link
Author

Can you make the --raw flag be --json instead so that it is inline with the other flags

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/minor Author minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI Metrics

3 participants