setup-guides

Uptime monitoring setup

One-time setup. Configures an external uptime monitor (UptimeRobot, BetterStack, Pingdom, etc.) to watch the HiveJournal backend's public /health endpoint and alert on outage. The on-platform work is done — what remains is a few clicks in whichever monitor service you pick.

What the /health endpoint returns

The public, no-auth backend health endpoint at https://hivejournalbackend-production.up.railway.app/health returns:

{
  "status": "ok",
  "timestamp": "2026-04-15T18:30:00.000Z",
  "started_at": "2026-04-15T17:45:12.000Z",
  "commit_sha": "abc1234..."
}
FieldMeaning
statusAlways "ok" if the process is running. (For deeper DB-roundtrip checks, see /api/admin/health — but that's auth-gated and not appropriate for an external monitor.)
timestampServer's current time, UTC.
started_atWhen the backend process last booted. A new value here means a deploy or restart.
commit_shaRailway's RAILWAY_GIT_COMMIT_SHA — the deployed commit. Useful for confirming a deploy actually shipped.

Best free tier (10 monitors, 30-second checks), good Slack/email integration, public status page included. Walkthrough:

  1. Sign up at https://uptime.betterstack.com (free tier).
  2. Create a monitor → "HTTP(s)" type:
    • URL: https://hivejournalbackend-production.up.railway.app/health
    • Check frequency: 1 minute (free tier ceiling) or 30 seconds (paid)
    • Request method: GET
    • Expected status code: 200
    • Keyword to find: "status":"ok" (catches the case where the endpoint returns 200 but with degraded JSON)
    • Regions: pick at least 2 (e.g., US-East + EU). Single-region false positives are common when AWS has a hiccup in one zone.
    • Recovery period: 1 minute (prevents flapping)
  3. Configure alerts:
    • Email: your on-call address
    • Optional: Slack webhook for a #alerts channel
    • Escalation: alert immediately on first failure → re-alert after 10 minutes if unresolved
  4. Create a public status page (optional):
    • Add the /health monitor to it
    • Custom subdomain: status.hivejournal.com (CNAME → BetterStack)
    • Auto-publish incidents from monitor failures
  5. Subscribe to the status page via RSS or email so you see incidents alongside the alert email.

Alternative: UptimeRobot

Cheaper paid tier than BetterStack, slightly less polished UI, 5-minute free check frequency.

  1. Sign up at https://uptimerobot.com (free tier — 50 monitors).
  2. Add new monitor → HTTP(s):
    • URL: https://hivejournalbackend-production.up.railway.app/health
    • Monitoring interval: 5 minutes (free) or 1 minute (paid)
    • Monitor SSL errors: on
    • Keyword monitoring: enable, search for "status":"ok"
  3. Alert contacts: add your email + optional Slack webhook
  4. Public status page: free tier supports one, customise the subdomain.

Alternative: native Vercel monitoring

The frontend is on Vercel, so the simplest possible setup is just turning on Vercel's built-in monitoring for the /api/health route on the frontend (if you add one) or the existing routes. Two caveats:

  • It only watches the frontend, not the Railway backend (which is the actual stateful service). Most outages worth alerting on are backend outages.
  • Free plan limits.

If you want monitoring purely as a "did the deploy succeed" smoke test, Vercel's built-in is enough. For real uptime monitoring of the stateful backend, use BetterStack or UptimeRobot above.

Smoke-test workflow

After configuring the monitor:

  1. Visit https://hivejournalbackend-production.up.railway.app/health in a browser. Confirm you see the JSON.
  2. Trigger a synthetic deploy via Railway (push a no-op commit) and confirm the monitor's "last checked" timestamp picks up the new commit_sha within ~5 minutes of the deploy completing.
  3. Optionally: pause the Railway service for 60 seconds to deliberately trigger an alert. Confirms email + Slack delivery actually works. Resume it.

Cross-references

  • The internal super-admin health page at /dashboard/admin/health is a richer view (DB latency, applied-vs-local migrations diff, commit SHA, Node version, uptime). External monitors should use /health (no auth required), not /api/admin/health.
  • The endpoint is implemented at apps/backend/src/index.ts (~line 88). If you need to add new fields to the response (e.g., a feature flag check), edit there — but keep the response shape backwards-compatible so existing monitors don't false-alarm.

Status

  • ✅ Backend /health endpoint upgraded (started_at, commit_sha exposed).
  • ✅ Internal admin health page shipped at /dashboard/admin/health.
  • ⏳ External monitor configuration — your action. Pick BetterStack and follow the steps above, takes ~10 minutes.
UPTIME MONITORING SETUP — Docs | HiveJournal