railway-metrics

Query CPU, memory, network, and disk usage metrics for Railway services via GraphQL.

30.5k|3.5k|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/davila7/claude-code-templates --skill railway-metrics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: railway-metrics
Source: https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/railway/metrics
Command: npx skills add https://github.com/davila7/claude-code-templates --skill railway-metrics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires railway-cli.

What problem does it solve?

Monitoring resource consumption on Railway requires navigating the dashboard or crafting raw GraphQL queries manually. This Skill lets you retrieve CPU, memory, network, and disk usage metrics for Railway services directly through the Railway CLI and GraphQL API.

Core Features & Use Cases

  • Resource Usage Queries: Fetch CPU usage, memory consumption, network traffic, and disk usage for any Railway service using the metrics GraphQL query.
  • Flexible Aggregation: Group metrics by deployment, instance, region, or service, and control sampling rate and averaging windows for time-series data.
  • Use Case: When a user asks "how much memory is my service using?", the Skill extracts the environmentId and serviceId from railway status --json, builds the metrics query with the correct time range, and returns timestamped usage values.

Quick Start

Ask the assistant to show CPU and memory usage for your Railway service over the last hour.

Frequently Asked Questions about railway-metrics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check memory usage of a Railway service?

Query the metrics endpoint with the MEMORY_USAGE_GB measurement, passing your environmentId and serviceId from railway status --json. The response returns timestamped values in GB over your specified time range.

How to get CPU metrics for all Railway services at once?

Omit the serviceId parameter and add groupBy: ["SERVICE_ID"] to the metrics query. This returns CPU_USAGE measurements tagged per service within the environment.

What metrics does the Railway GraphQL API support?

The API supports CPU_USAGE, CPU_LIMIT, MEMORY_USAGE_GB, MEMORY_LIMIT_GB, NETWORK_RX_GB, NETWORK_TX_GB, DISK_USAGE_GB, EPHEMERAL_DISK_USAGE_GB, and BACKUP_USAGE_GB measurements.

Why does my Railway metrics query return empty results?

Empty metrics occur when the service has no active deployment, the time range excludes the deployment period, or the service is new with no traffic. Verify the service is running and adjust startDate to cover active periods.

Can I group Railway metrics by region or deployment?

Yes, use the groupBy parameter with MetricTag values DEPLOYMENT_ID, DEPLOYMENT_INSTANCE_ID, REGION, or SERVICE_ID. Results include a tags object identifying each metric series.