How to Monitor Your Railway Application with Vigilmon
Railway is a developer-friendly platform for deploying apps, databases, and services. It handles deployments, scaling, and networking — but external uptime monitoring is your responsibility. Here's how to monitor your Railway application with Vigilmon.
What Railway Handles vs. What You Monitor
Railway provides:
- Automatic deployments from GitHub
- Health check restarts (if you configure them)
- Built-in metrics (CPU, memory, network)
- Automatic HTTPS via Let's Encrypt
Railway does NOT provide:
- External uptime monitoring with team alerts
- Response time tracking from end-user perspectives
- SSL expiry warnings (auto-renew can fail)
- Heartbeat monitoring for cron jobs
- Incident history with timestamps for SLA reporting
Vigilmon fills these gaps.
Step 1: Add a Health Endpoint to Your App
Add a simple health route that Vigilmon can check:
Node.js/Express:
app.get('/health', (req, res) => {
res.json({ status: 'ok', timestamp: Date.now() });
});
Python/FastAPI:
@app.get("/health")
async def health():
return {"status": "ok"}
Go:
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
})
Ruby on Rails:
# config/routes.rb
get '/health', to: proc { [200, {}, ['OK']] }
Laravel (PHP):
// routes/web.php
Route::get('/health', fn() => response()->json(['status' => 'ok']));
Step 2: Set Up Vigilmon
- Sign up at vigilmon.online
- Click New Monitor → HTTP Monitor
- Enter your Railway app URL:
https://your-app.up.railway.app/health- Or your custom domain if configured
- Check interval: 1 minute
- Expected status:
200 - Add alert channels (email, Slack, PagerDuty)
- Save
Vigilmon starts checking from multiple regions immediately.
Step 3: Configure Railway Health Checks
For Railway's own restart behavior, add health check configuration in your railway.toml:
[deploy]
healthcheckPath = "/health"
healthcheckTimeout = 100
This tells Railway to wait for /health to return 200 before considering a deployment successful. Combined with Vigilmon, you get both automatic restarts and team alerting.
Step 4: SSL Certificate Monitoring
- New Monitor → SSL Certificate
- Domain:
your-app.up.railway.appor your custom domain - Alert threshold: 30 days before expiry
Railway uses Let's Encrypt (90-day certs). If auto-renewal fails, you need to know 30 days early, not on the day it expires.
Step 5: Monitor Railway Databases
If you're using Railway's managed PostgreSQL, MySQL, or Redis, add a database health check via your app:
Node.js database health endpoint:
app.get('/health', async (req, res) => {
try {
await db.query('SELECT 1'); // Quick connectivity check
res.json({ status: 'ok', database: 'ok' });
} catch (err) {
res.status(500).json({ status: 'error', database: 'unreachable' });
}
});
This catches Railway database issues via your app's perspective.
Step 6: Heartbeat Monitors for Railway Cron Jobs
Railway supports cron jobs via the platform's scheduler. Add heartbeat monitoring:
- In Vigilmon, create a Heartbeat Monitor
- Copy the unique ping URL
- Add a curl command at the end of your cron job:
In your cron job script:
#!/bin/bash
# Your job logic
node scripts/daily-cleanup.js
# Ping Vigilmon on success
curl -s "https://vigilmon.online/ping/your-heartbeat-id" > /dev/null
If your Railway cron job fails or stops, Vigilmon detects the missed heartbeat and alerts you.
Step 7: Monitor After Each Deployment
Railway deploys automatically from GitHub pushes. Add Vigilmon checks to your deployment workflow:
GitHub Actions post-deploy check:
- name: Verify deployment health
run: |
sleep 30 # Wait for Railway deployment
curl -f https://your-app.up.railway.app/health || exit 1
And check your Vigilmon dashboard after each deploy to confirm the app came back healthy.
Railway Failure Modes
| Failure | Vigilmon Detects? |
|---|---|
| Container crash / OOM | Yes — HTTP check fails during restart |
| Railway platform incident | Yes — external monitoring catches it |
| Database connection lost | Yes — enhanced health endpoint returns 500 |
| SSL renewal failure | Yes — SSL monitor |
| Bad deploy (errors) | Yes — immediate HTTP check failure |
| Cron job stopped | Yes — heartbeat monitor |
| Memory limits exceeded | Yes — slow responses → timeout alert |
Railway vs. Vigilmon: Complementary Roles
| Feature | Railway | Vigilmon |
|---|---|---|
| CPU/memory metrics | Yes | No |
| Deploy logs | Yes | No |
| Health check restarts | Yes | No |
| External uptime monitoring | No | Yes |
| Response time from user perspective | No | Yes |
| SSL expiry alerts | No | Yes |
| Team alerting (Slack/PagerDuty) | No | Yes |
| Incident history / SLA data | No | Yes |
| Heartbeat / cron monitoring | No | Yes |
Use Railway's dashboard for infrastructure metrics and deploys. Use Vigilmon for what your users actually experience.
Summary
Monitoring your Railway application with Vigilmon:
- Add
/healthendpoint to your app - Configure Railway's
healthcheckPathinrailway.toml - Create HTTP uptime monitor in Vigilmon
- Add SSL certificate monitor
- Add heartbeat monitors for cron jobs
- Set up Slack + email + PagerDuty alerts
Railway's internal metrics tell you about infrastructure; Vigilmon tells you what your users are experiencing.
Monitor your Railway application with Vigilmon — free to start.
Top comments (0)