DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Railway.app Applications with Vigilmon

How to Monitor Railway.app Applications with Vigilmon

Railway has become one of the fastest ways to deploy web applications - push code, Railway handles the infrastructure. But Railway's internal health checks don't replace external uptime monitoring. They tell you if a deployment succeeded; they don't tell you if your app is actually reachable from the internet.

Here's how to set up external monitoring for Railway-hosted apps with Vigilmon.

Why Railway Apps Need External Monitoring

Railway provides deployment logs, usage metrics, and basic service status. What it doesn't provide:

  • External reachability checks - is your domain resolving and your app responding from outside Railway's network?
  • SSL/TLS monitoring - are your certificates valid and when do they expire?
  • Response body verification - is your app responding with valid content, not an error page?
  • Alert routing - PagerDuty, Slack, email when something goes wrong at 3am

Railway's built-in tools are great for development and deployment visibility. Vigilmon fills the production monitoring gap.

Step 1: Add a Health Check Endpoint

Before adding monitoring, give Vigilmon something meaningful to check. Add a /health endpoint to your app:

Express.js:
javascript
app.get('/health', async (req, res) => {
try {
// Optionally check DB connectivity
await db.query('SELECT 1');
res.json({ status: 'ok', timestamp: new Date().toISOString() });
} catch (err) {
res.status(503).json({ status: 'error', message: err.message });
}
});

FastAPI (Python):
python
@app.get("/health")
async def health():
return {"status": "ok", "timestamp": datetime.utcnow().isoformat()}

Django:
`python

urls.py

from django.http import JsonResponse

def health(request):
return JsonResponse({"status": "ok"})

urlpatterns = [
path('health', health),
# ...
]
`

Deploy your updated app to Railway.

Step 2: Find Your Railway Domain

Railway assigns a public domain to each service (e.g., your-app.railway.app) unless you've attached a custom domain. Either works for monitoring.

If you've configured a custom domain in Railway settings, use that - it tests the full DNS ? Railway ? app chain.

Step 3: Set Up Vigilmon

  1. Sign up at vigilmon.online
  2. Click Add Monitor
  3. Select HTTP(S)
  4. Enter your Railway app URL: https://your-app.railway.app/health
  5. Method: GET
  6. Keyword check: Enter "status":"ok" - this ensures Vigilmon only marks the monitor as up when your health check fully passes, not just when it returns HTTP 200
  7. Check interval: 1 minute (recommended for production)
  8. Alert channels: Configure email, Slack, or webhook

Step 4: Add SSL Monitoring

Railway handles SSL provisioning automatically, but certificates can still expire or fail to renew. Add a separate SSL monitor:

  1. Add a new monitor
  2. Select SSL Certificate
  3. Enter your domain
  4. Set alert threshold: 14 days before expiry

Step 5: Monitor Critical Endpoints

Don't just monitor your homepage. Add monitors for:

  • /health - overall server health
  • /api/health - API layer (if separate from frontend)
  • Your most important user-facing routes (login page, checkout, etc.)

Handling Railway's Sleep Behavior

Railway's Starter plan can put services to sleep after inactivity. Vigilmon's monitoring automatically keeps your service awake by sending regular health check requests - a useful side effect if you're on a plan that allows it.

On Railway's Pro plan and above, services don't sleep, so this isn't a concern.

Heartbeat Monitoring for Cron Jobs

If you're running scheduled tasks on Railway (using Railway's cron service or a background worker), add heartbeat monitoring:

`javascript
// In your cron job
const VIGILMON_HB_URL = process.env.VIGILMON_HB_URL;

async function runDailyReport() {
// ...your job logic

// Signal Vigilmon job completed
if (VIGILMON_HB_URL) {
await fetch(VIGILMON_HB_URL, { method: 'POST' }).catch(() => {});
}
}
`

Add the heartbeat URL as a Railway environment variable. Vigilmon alerts you if the job hasn't checked in within the expected window.

Monitoring Multiple Railway Services

If your app is a microservices setup on Railway (API gateway, auth service, data service), add a Vigilmon monitor for each service. Railway makes it easy to give each service its own domain, and Vigilmon makes it easy to monitor all of them.

A typical setup:

  • pi.yourapp.com/health ? API service monitor
  • uth.yourapp.com/health ? Auth service monitor
  • yourapp.com ? Frontend monitor
  • SSL certificate monitor for each domain

Summary

Railway's deployment experience is hard to beat. Adding Vigilmon takes about 5 minutes and gives you the external visibility that Railway's internal tooling doesn't provide - so you hear about outages from your monitors, not your users.

Start free on Vigilmon - no credit card required.

Top comments (0)