jpskill.com
🛠️ 開発・MCP コミュニティ

railway-observability

Railway.comのメトリクス、監視ダッシュボード、アラート設定、Grafana連携機能を利用し、監視体制構築、ダッシュボード作成、Prometheus/Loki/Tempo統合、サービス指標分析などを効率的に行うSkill。

📜 元の英語説明(参考)

Railway.com built-in metrics, monitoring dashboards, alerting (Pro plan), and external OTEL integration with Grafana. Use when setting up monitoring, creating dashboards, configuring alerts, integrating Prometheus/Loki/Tempo, deploying Grafana stack, or analyzing Railway service metrics.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Railway.comのメトリクス、監視ダッシュボード、アラート設定、Grafana連携機能を利用し、監視体制構築、ダッシュボード作成、Prometheus/Loki/Tempo統合、サービス指標分析などを効率的に行うSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o railway-observability.zip https://jpskill.com/download/9475.zip && unzip -o railway-observability.zip && rm railway-observability.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9475.zip -OutFile "$d\railway-observability.zip"; Expand-Archive "$d\railway-observability.zip" -DestinationPath $d -Force; ri "$d\railway-observability.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して railway-observability.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → railway-observability フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Railway の可観測性

Railway.com の可観測性に関する包括的なガイドです。組み込みのメトリクス、カスタマイズ可能なダッシュボード、アラート機能(Pro プラン)、および Grafana/Prometheus/Loki/Tempo との外部 OTEL 連携について説明します。

概要

Railway は、多層的な可観測性機能を提供します。

  • 組み込みのメトリクス(CPU、メモリ、ディスク、ネットワーク)
  • ドラッグアンドドロップウィジェットによるカスタマイズ可能なダッシュボード
  • メールおよび Webhook 連携によるアラート機能(Pro プラン)
  • Grafana Alloy を介した外部 OTEL 連携
  • フル可観測性スタックのデプロイ(Grafana テンプレート)

キーワード: metrics, monitoring, observability, dashboard, alerts, Grafana, Prometheus, Loki, Tempo, OTEL, Alloy, Railway

この Skill を使用する場面

  • Railway サービスのモニタリング設定
  • カスタム可観測性ダッシュボードの作成
  • リソース閾値に対するアラートの設定
  • 外部モニタリングシステムとの連携
  • Grafana 可観測性スタックのデプロイ
  • サービスパフォーマンスメトリクスの分析
  • リソース問題のトラブルシューティング
  • 分散トレーシングの設定

クイックスタート

1. 組み込みの可観測性ダッシュボードへのアクセス

Railway プロジェクトに移動します。

Railway Dashboard → Project → Service → Metrics Tab

表示される内容:

  • CPU 使用率(割り当てられたリソースに対する割合)
  • メモリ使用量(時間経過に伴う MB/GB)
  • ディスク使用量(ストレージ消費量)
  • ネットワーク I/O(イングレス/イーグレス)
  • 30 日間のメトリクス保持

2. カスタムダッシュボードウィジェットの設定

メトリクスウィジェットを追加およびカスタマイズします。

Metrics Tab → Add Widget → Select Metric Type

利用可能なウィジェット:

  • 折れ線グラフ(時系列メトリクス)
  • 棒グラフ(デプロイメントの比較)
  • ゲージ(現在の値)
  • テーブル(複数メトリクスの表示)

カスタマイズ:

  • ドラッグアンドドロップレイアウト
  • 調整可能な時間範囲(1h, 6h, 24h, 7d, 30d)
  • 複数レプリカの集約
  • チャート上のデプロイメントマーカー

3. アラートの設定(Pro プランが必要)

閾値違反に対するアラートを設定します。

Service Settings → Alerts → Create Alert Rule

アラートの種類:

  • CPU 閾値(例:5 分間 > 80%)
  • メモリ閾値(例:10 分間 > 90%)
  • ディスク使用量(例:> 85%)
  • カスタムメトリクス閾値

通知チャネル:

  • メール(デフォルト)
  • Discord webhook
  • Slack webhook
  • カスタム webhook (JSON payload)

4. 外部 OTEL コレクターとの連携

メトリクスを外部システムにエクスポートします。

Service Settings → Observability → OTEL Integration

環境変数の設定:

OTEL_EXPORTER_OTLP_ENDPOINT=https://your-collector:4318
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer <token>
OTEL_SERVICE_NAME=my-railway-service

完全な設定については、references/otel-integration.md を参照してください。

5. フル Grafana スタックのデプロイ

完全な可観測性のために Railway テンプレートを使用します。

# Option 1: Deploy via Railway Dashboard
# Template ID: 8TLSQD (Grafana Stack)
# Includes: Grafana, Prometheus, Loki, Tempo, Alloy

# Option 2: Deploy via script
.claude/skills/railway-observability/scripts/deploy-grafana-stack.sh

スタックコンポーネント:

  • Grafana (visualization)
  • Prometheus (metrics)
  • Loki (logs)
  • Tempo (traces)
  • Alloy (collector)

ワークフロー

ステップ 1: 組み込みのメトリクスへのアクセス

Railway は、設定なしで即座にメトリクスを提供します。

メトリクスへの移動:

Project → Service → Metrics

利用可能なメトリクス:

  • CPU: % 使用率、割り当てられたコア数
  • メモリ: 使用済み MB、制限に対する %
  • ディスク: 使用済み GB、読み取り/書き込み IOPS
  • ネットワーク: MB/s イングレス/イーグレス

保持期間: すべてのメトリクスに対して 30 日間

ステップ 2: ダッシュボードのカスタマイズ

パーソナライズされたモニタリングビューを作成します。

ウィジェットの追加:

  1. 「Add Widget」をクリックします
  2. メトリクスの種類を選択します
  3. 集約を設定します
  4. 時間範囲を設定します
  5. ドラッグアンドドロップで配置します

ベストプラクティス:

  • 関連するメトリクスをグループ化します(CPU + メモリ)
  • 相関関係のためにデプロイメントマーカーを使用します
  • 複数レプリカのビューを設定します
  • 適切な時間範囲を設定します

ステップ 3: アラートの設定(Pro プラン)

プロアクティブなモニタリングを設定します。

アラートルールの作成:

Service → Settings → Alerts → New Rule

アラートの設定:

Metric: CPU Usage
Condition: Greater than 80%
Duration: 5 minutes
Notification: Slack webhook

Webhook ペイロードの例:

{
  "service": "backend-production",
  "metric": "cpu_usage",
  "threshold": 80,
  "current": 87.5,
  "timestamp": "2025-11-26T10:30:00Z"
}

すべてのアラートの種類については、references/dashboard-widgets.md を参照してください。

ステップ 4: OTEL エクスポーターとの連携

メトリクスを外部システムに送信します。

Alloy コレクターの設定:

# templates/alloy-config.river のテンプレートを使用します
# Railway サービスとしてデプロイします
# OTEL エンドポイントを設定します

環境設定:

# Railway サービス内
OTEL_EXPORTER_OTLP_ENDPOINT=http://alloy:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_TRACES_EXPORTER=otlp

連携の確認:

# Alloy ログの確認
railway logs -s alloy

# "Successfully received OTLP metrics" と表示されるはずです

完全なガイドについては、references/otel-integration.md を参照してください。

ステップ 5: Grafana 可観測性スタックのデプロイ

Railway 上のフルモニタリングソリューションです。

スタックのデプロイ:

# デプロイスクリプトの実行
cd .claude/skills/railway-observability/scripts
./deploy-grafana-stack.sh

# または Railway Dashboard 経由で手動でデプロイ
# Template: 8TLSQD (Grafana Stack)

スタックに含まれるもの:

  • Grafana (port 3000) - ダッシュボード
  • Prometheus (port 9090) - メトリクスストレージ
  • Loki (port 3100) - ログ集約
  • Tempo (port 3200) - 分散トレーシング
  • Alloy (port 4318) - OTLP コレクター

Grafana へのアクセス:

URL: https://<grafana-service>.up.railway.app
Username: admin
Password: (set during deployment)

アーキテクチャ

段階的な情報開示構造

  1. SKILL.md (このファイル): クイックスタートとワークフロー
  2. references/: 詳細なドキュメント
    • metrics-reference.md - 完全なメトリクスカタログ
    • dashboard-widgets.md - ウィジェット設定ガイド
    • otel-integration.md - 外部連携の設定
  3. scripts/: 自動化ツール
    • deploy-grafana-stack.sh - 可観測性スタックのデプロイ

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Railway Observability

Comprehensive guide for Railway.com observability including built-in metrics, customizable dashboards, alerting (Pro plan), and external OTEL integration with Grafana/Prometheus/Loki/Tempo.

Overview

Railway provides multi-tier observability capabilities:

  • Built-in metrics (CPU, memory, disk, network)
  • Customizable dashboards with drag-and-drop widgets
  • Alerting with email and webhook integrations (Pro plan)
  • External OTEL integration via Grafana Alloy
  • Full observability stack deployment (Grafana template)

Keywords: metrics, monitoring, observability, dashboard, alerts, Grafana, Prometheus, Loki, Tempo, OTEL, Alloy, Railway

When to Use This Skill

  • Setting up monitoring for Railway services
  • Creating custom observability dashboards
  • Configuring alerts for resource thresholds
  • Integrating external monitoring systems
  • Deploying Grafana observability stack
  • Analyzing service performance metrics
  • Troubleshooting resource issues
  • Setting up distributed tracing

Quick Start

1. Access Built-in Observability Dashboard

Navigate to your Railway project:

Railway Dashboard → Project → Service → Metrics Tab

What you see:

  • CPU usage (% of allocated resources)
  • Memory usage (MB/GB over time)
  • Disk usage (storage consumption)
  • Network I/O (ingress/egress)
  • 30-day metric retention

2. Configure Custom Dashboard Widgets

Add and customize metric widgets:

Metrics Tab → Add Widget → Select Metric Type

Available widgets:

  • Line charts (time-series metrics)
  • Bar charts (deployment comparisons)
  • Gauges (current values)
  • Tables (multi-metric views)

Customization:

  • Drag-and-drop layout
  • Adjustable time ranges (1h, 6h, 24h, 7d, 30d)
  • Multi-replica aggregation
  • Deployment markers on charts

3. Set Up Alerting (Pro Plan Required)

Configure alerts for threshold violations:

Service Settings → Alerts → Create Alert Rule

Alert types:

  • CPU threshold (e.g., > 80% for 5 minutes)
  • Memory threshold (e.g., > 90% for 10 minutes)
  • Disk usage (e.g., > 85%)
  • Custom metric thresholds

Notification channels:

  • Email (default)
  • Discord webhook
  • Slack webhook
  • Custom webhook (JSON payload)

4. Integrate External OTEL Collectors

Export metrics to external systems:

Service Settings → Observability → OTEL Integration

Configure environment variables:

OTEL_EXPORTER_OTLP_ENDPOINT=https://your-collector:4318
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer <token>
OTEL_SERVICE_NAME=my-railway-service

See references/otel-integration.md for complete setup.

5. Deploy Full Grafana Stack

Use Railway template for complete observability:

# Option 1: Deploy via Railway Dashboard
# Template ID: 8TLSQD (Grafana Stack)
# Includes: Grafana, Prometheus, Loki, Tempo, Alloy

# Option 2: Deploy via script
.claude/skills/railway-observability/scripts/deploy-grafana-stack.sh

Stack components:

  • Grafana (visualization)
  • Prometheus (metrics)
  • Loki (logs)
  • Tempo (traces)
  • Alloy (collector)

Workflow

Step 1: Access Built-in Metrics

Railway provides instant metrics without configuration.

Navigate to metrics:

Project → Service → Metrics

Available metrics:

  • CPU: % usage, allocated cores
  • Memory: MB used, % of limit
  • Disk: GB used, read/write IOPS
  • Network: MB/s ingress/egress

Retention: 30 days for all metrics

Step 2: Customize Dashboard

Create personalized monitoring views.

Add widgets:

  1. Click "Add Widget"
  2. Select metric type
  3. Configure aggregation
  4. Set time range
  5. Position via drag-and-drop

Best practices:

  • Group related metrics (CPU + Memory)
  • Use deployment markers for correlation
  • Configure multi-replica views
  • Set appropriate time ranges

Step 3: Configure Alerts (Pro Plan)

Set up proactive monitoring.

Create alert rule:

Service → Settings → Alerts → New Rule

Alert configuration:

Metric: CPU Usage
Condition: Greater than 80%
Duration: 5 minutes
Notification: Slack webhook

Webhook payload example:

{
  "service": "backend-production",
  "metric": "cpu_usage",
  "threshold": 80,
  "current": 87.5,
  "timestamp": "2025-11-26T10:30:00Z"
}

See references/dashboard-widgets.md for all alert types.

Step 4: Integrate OTEL Exporters

Send metrics to external systems.

Configure Alloy collector:

# Use template from templates/alloy-config.river
# Deploy as Railway service
# Configure OTEL endpoints

Environment setup:

# In your Railway service
OTEL_EXPORTER_OTLP_ENDPOINT=http://alloy:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_TRACES_EXPORTER=otlp

Verify integration:

# Check Alloy logs
railway logs -s alloy

# Should show: "Successfully received OTLP metrics"

See references/otel-integration.md for complete guide.

Step 5: Deploy Grafana Observability Stack

Full monitoring solution on Railway.

Deploy stack:

# Run deployment script
cd .claude/skills/railway-observability/scripts
./deploy-grafana-stack.sh

# Or deploy manually via Railway Dashboard
# Template: 8TLSQD (Grafana Stack)

Stack includes:

  • Grafana (port 3000) - Dashboards
  • Prometheus (port 9090) - Metrics storage
  • Loki (port 3100) - Log aggregation
  • Tempo (port 3200) - Distributed tracing
  • Alloy (port 4318) - OTLP collector

Access Grafana:

URL: https://<grafana-service>.up.railway.app
Username: admin
Password: (set during deployment)

Architecture

Progressive Disclosure Structure

  1. SKILL.md (this file): Quick start and workflow
  2. references/: Detailed documentation
    • metrics-reference.md - Complete metrics catalog
    • dashboard-widgets.md - Widget configuration guide
    • otel-integration.md - External integration setup
  3. scripts/: Automation tools
    • deploy-grafana-stack.sh - Deploy observability stack
  4. templates/: Configuration files
    • alloy-config.river - Grafana Alloy collector config

Key Features

Built-in Metrics (Always Available)

Metric Description Units Retention
CPU % of allocated cores Percentage 30 days
Memory RAM usage MB/GB 30 days
Disk Storage consumption GB 30 days
Network I/O Ingress/egress traffic MB/s 30 days

No configuration required - Metrics collected automatically for all services.

Dashboard Customization

Drag-and-drop widgets:

  • Resize and reposition
  • Multiple chart types
  • Custom time ranges
  • Deployment markers

Multi-replica support:

  • Aggregated views (avg, min, max, sum)
  • Per-replica breakdowns
  • Replica scaling events

Time range options:

  • Last 1 hour
  • Last 6 hours
  • Last 24 hours
  • Last 7 days
  • Last 30 days
  • Custom range

Alerting (Pro Plan Only)

Threshold alerts:

  • CPU > X% for Y minutes
  • Memory > X MB for Y minutes
  • Disk > X% capacity
  • Network > X MB/s

Notification channels:

# Email
alert@example.com

# Discord webhook
https://discord.com/api/webhooks/...

# Slack webhook
https://hooks.slack.com/services/...

# Custom webhook
https://your-api.com/alerts

Alert states:

  • Pending (condition met, waiting duration)
  • Firing (threshold exceeded)
  • Resolved (back to normal)

OTEL Integration

Supported protocols:

  • OTLP/HTTP (port 4318)
  • OTLP/gRPC (port 4317)

Signal types:

  • Metrics (Prometheus format)
  • Logs (JSON structured)
  • Traces (Jaeger/Zipkin format)

Collector options:

  • Grafana Alloy (recommended)
  • OpenTelemetry Collector
  • Custom OTLP exporters

Grafana Stack Details

Template Deployment (8TLSQD)

One-click deployment:

Railway Dashboard → New Project → Deploy Template → Search "8TLSQD"

Services deployed:

  1. Grafana (visualization)
  2. Prometheus (time-series DB)
  3. Loki (log aggregation)
  4. Tempo (trace storage)
  5. Alloy (OTLP collector)

Configuration:

  • Pre-configured data sources
  • Sample dashboards included
  • Persistent storage volumes
  • Internal networking enabled

Alloy Collector

Purpose: Receive OTLP signals from Railway services and forward to Grafana stack.

Configuration (templates/alloy-config.river):

// OTLP receiver
otelcol.receiver.otlp "default" {
  grpc {
    endpoint = "0.0.0.0:4317"
  }
  http {
    endpoint = "0.0.0.0:4318"
  }

  output {
    metrics = [otelcol.exporter.prometheus.default.input]
    logs    = [otelcol.exporter.loki.default.input]
    traces  = [otelcol.exporter.otlp.tempo.input]
  }
}

// Prometheus exporter
otelcol.exporter.prometheus "default" {
  forward_to = [prometheus.remote_write.railway.receiver]
}

// Loki exporter
otelcol.exporter.loki "default" {
  forward_to = [loki.write.railway.receiver]
}

// Tempo exporter
otelcol.exporter.otlp "tempo" {
  client {
    endpoint = "tempo:4317"
  }
}

Grafana Dashboards

Pre-built dashboards:

  • Railway Service Metrics (CPU, Memory, Disk, Network)
  • OTLP Metrics Overview
  • Log Analytics (Loki)
  • Trace Explorer (Tempo)

Custom dashboards:

  • Create via Grafana UI
  • Import from Grafana.com
  • Build with JSON models

Integration Examples

Example 1: Monitor Node.js Service

# Install OTEL SDK
npm install @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node

# Configure OTEL (in Railway service)
export OTEL_EXPORTER_OTLP_ENDPOINT=http://alloy:4318
export OTEL_SERVICE_NAME=nodejs-backend
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
export OTEL_TRACES_EXPORTER=otlp

# Auto-instrumentation
node --require @opentelemetry/auto-instrumentations-node/register app.js

View in Grafana:

  • Metrics: Grafana → Dashboards → Railway Service Metrics
  • Logs: Grafana → Explore → Loki
  • Traces: Grafana → Explore → Tempo

Example 2: Alert on High Memory

# Pro Plan: Service → Alerts → New Rule
Name: High Memory Alert
Metric: Memory Usage
Condition: Greater than 512 MB
Duration: 10 minutes
Notification: Slack webhook
Webhook URL: https://hooks.slack.com/services/YOUR/WEBHOOK/URL

Slack notification:

{
  "text": "🚨 High Memory Alert",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*Service*: backend-production\n*Memory*: 567 MB (> 512 MB threshold)\n*Duration*: 12 minutes"
      }
    }
  ]
}

Example 3: Custom Metrics from Python

from opentelemetry import metrics
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter

# Configure OTLP exporter
exporter = OTLPMetricExporter(
    endpoint="http://alloy:4318/v1/metrics"
)

# Create meter provider
provider = MeterProvider(metric_readers=[
    PeriodicExportingMetricReader(exporter, export_interval_millis=60000)
])
metrics.set_meter_provider(provider)

# Create custom metrics
meter = metrics.get_meter(__name__)
request_counter = meter.create_counter("api_requests_total")
response_time = meter.create_histogram("api_response_time_seconds")

# Record metrics
request_counter.add(1, {"endpoint": "/api/users", "method": "GET"})
response_time.record(0.125, {"endpoint": "/api/users"})

View in Grafana:

Explore → Prometheus → Metrics Browser → api_requests_total

Cross-References

  • railway-api: Query metrics via GraphQL API
  • railway-logs: Log aggregation (complements metrics)
  • railway-deployment: Deployment marker correlation
  • observability-stack-setup: Local LGTM stack (similar to Railway stack)

Troubleshooting

Metrics Not Showing

Check service status:

railway status -s <service-name>

Verify metrics enabled:

  • Metrics are always enabled
  • Check service is running
  • Wait 1-2 minutes for first data points

Alerts Not Firing

Requirements:

  • Pro plan subscription required
  • Alert rule properly configured
  • Condition met for full duration
  • Valid notification channel

Debug checklist:

1. Verify Pro plan active
2. Check threshold configuration
3. Confirm duration setting
4. Test webhook URL manually
5. Check Railway dashboard for alert status

OTEL Integration Issues

Common problems:

  • Incorrect endpoint URL
  • Network connectivity (use internal Railway URLs)
  • Authentication headers missing
  • Protocol mismatch (HTTP vs gRPC)

Verify Alloy receiving data:

# Check Alloy logs
railway logs -s alloy

# Look for:
# ✅ "OTLP receiver started"
# ✅ "Received X metric points"
# ❌ "Connection refused" = endpoint issue
# ❌ "Unauthorized" = auth issue

See references/otel-integration.md for detailed troubleshooting.

Best Practices

Dashboard Design

  1. Group related metrics (CPU + Memory together)
  2. Use deployment markers to correlate changes
  3. Set appropriate time ranges (7d for trends, 1h for incidents)
  4. Create separate dashboards for different services
  5. Use multi-replica views for scaled services

Alerting Strategy

  1. Set thresholds based on actual usage patterns
  2. Use duration to avoid false positives (5-10 min)
  3. Test notification channels before production
  4. Document escalation procedures
  5. Review and tune alerts regularly

OTEL Integration

  1. Use internal Railway URLs (no egress costs)
  2. Batch metrics for efficiency (60s intervals)
  3. Add service tags for filtering
  4. Use sampling for high-volume traces
  5. Monitor collector resource usage

Grafana Stack

  1. Enable persistent volumes for data retention
  2. Configure backup strategy
  3. Secure Grafana with strong password
  4. Use Railway internal networking
  5. Monitor stack resource consumption

Quick Reference

Accessing Observability

# Railway Dashboard
https://railway.app/project/<project-id>/service/<service-id>/metrics

# Via Railway CLI
railway status -s <service-name>
railway metrics -s <service-name>

Common Alert Thresholds

Metric Warning Critical
CPU 70% 90%
Memory 75% 90%
Disk 80% 95%
Network 80% bandwidth 95% bandwidth

OTEL Environment Variables

OTEL_EXPORTER_OTLP_ENDPOINT=http://alloy:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_SERVICE_NAME=my-service
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_TRACES_EXPORTER=otlp

Grafana Stack Template

Template ID: 8TLSQD
Components: Grafana, Prometheus, Loki, Tempo, Alloy
Deployment: Railway Dashboard → New Project → Deploy Template
Cost: ~$20-30/month (depends on usage)

Resources

Notes

  • Built-in metrics are free for all plans
  • Alerting requires Pro plan ($20/month)
  • OTEL integration works on all plans
  • Grafana stack deploys as separate Railway services
  • Metrics retained for 30 days
  • Use internal Railway URLs for OTEL (no egress costs)
  • Deployment markers automatically added to charts
  • Multi-replica metrics aggregated automatically

Updated: November 26, 2025 Template ID: 8TLSQD (Grafana Stack) Retention: 30 days (built-in metrics)