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.
59
68%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skills/railway-observability/SKILL.mdComprehensive guide for Railway.com observability including built-in metrics, customizable dashboards, alerting (Pro plan), and external OTEL integration with Grafana/Prometheus/Loki/Tempo.
Railway provides multi-tier observability capabilities:
Keywords: metrics, monitoring, observability, dashboard, alerts, Grafana, Prometheus, Loki, Tempo, OTEL, Alloy, Railway
Navigate to your Railway project:
Railway Dashboard → Project → Service → Metrics TabWhat you see:
Add and customize metric widgets:
Metrics Tab → Add Widget → Select Metric TypeAvailable widgets:
Customization:
Configure alerts for threshold violations:
Service Settings → Alerts → Create Alert RuleAlert types:
Notification channels:
Export metrics to external systems:
Service Settings → Observability → OTEL IntegrationConfigure environment variables:
OTEL_EXPORTER_OTLP_ENDPOINT=https://your-collector:4318
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer <token>
OTEL_SERVICE_NAME=my-railway-serviceSee references/otel-integration.md for complete setup.
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.shStack components:
Railway provides instant metrics without configuration.
Navigate to metrics:
Project → Service → MetricsAvailable metrics:
Retention: 30 days for all metrics
Create personalized monitoring views.
Add widgets:
Best practices:
Set up proactive monitoring.
Create alert rule:
Service → Settings → Alerts → New RuleAlert configuration:
Metric: CPU Usage
Condition: Greater than 80%
Duration: 5 minutes
Notification: Slack webhookWebhook 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.
Send metrics to external systems.
Configure Alloy collector:
# Use template from templates/alloy-config.river
# Deploy as Railway service
# Configure OTEL endpointsEnvironment 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=otlpVerify integration:
# Check Alloy logs
railway logs -s alloy
# Should show: "Successfully received OTLP metrics"See references/otel-integration.md for complete guide.
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:
Access Grafana:
URL: https://<grafana-service>.up.railway.app
Username: admin
Password: (set during deployment)metrics-reference.md - Complete metrics catalogdashboard-widgets.md - Widget configuration guideotel-integration.md - External integration setupdeploy-grafana-stack.sh - Deploy observability stackalloy-config.river - Grafana Alloy collector config| 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.
Drag-and-drop widgets:
Multi-replica support:
Time range options:
Threshold alerts:
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/alertsAlert states:
Supported protocols:
Signal types:
Collector options:
One-click deployment:
Railway Dashboard → New Project → Deploy Template → Search "8TLSQD"Services deployed:
Configuration:
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"
}
}Pre-built dashboards:
Custom dashboards:
# 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.jsView in Grafana:
# 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/URLSlack 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"
}
}
]
}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_totalCheck service status:
railway status -s <service-name>Verify metrics enabled:
Requirements:
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 statusCommon problems:
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 issueSee references/otel-integration.md for detailed troubleshooting.
# 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>| Metric | Warning | Critical |
|---|---|---|
| CPU | 70% | 90% |
| Memory | 75% | 90% |
| Disk | 80% | 95% |
| Network | 80% bandwidth | 95% bandwidth |
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=otlpTemplate ID: 8TLSQD
Components: Grafana, Prometheus, Loki, Tempo, Alloy
Deployment: Railway Dashboard → New Project → Deploy Template
Cost: ~$20-30/month (depends on usage)Updated: November 26, 2025 Template ID: 8TLSQD (Grafana Stack) Retention: 30 days (built-in metrics)
93ed392
Also appears in
since Sep 12, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.