tutorial

How to Monitor Omi with Vigilmon

Add production-grade uptime monitoring to your Omi application — health endpoint, HTTP and keyword monitors in Vigilmon, and alerting via Slack or email.

How to Monitor Omi with Vigilmon

Omi unifies Web Components, JSX, and reactive state into a single framework that runs fast on any modern browser. But once your Omi app is deployed, you need an external observer watching the production URL — the framework's flexibility doesn't shield you from server failures or broken deploys.

This tutorial covers:

  • A /health endpoint alongside your Omi app
  • An HTTP uptime monitor in Vigilmon
  • A keyword monitor that confirms your Omi components actually render
  • Slack or email alerts when anything fails

Full setup takes about 15 minutes.


Step 1: Add a health endpoint to your server

Omi renders client-side, so you need a server to expose a health route. Here's a minimal Express setup:

// server.js
import express from 'express';

const app = express();

app.get('/health', (req, res) => {
  res.json({
    status: 'ok',
    service: 'omi-app',
    timestamp: new Date().toISOString(),
  });
});

app.use(express.static('dist'));

app.listen(3000, () => console.log('Server running on port 3000'));

Test it locally:

node server.js
curl http://localhost:3000/health
# {"status":"ok","service":"omi-app","timestamp":"..."}

For a deeper check that validates your component data sources:

app.get('/health', async (req, res) => {
  const checks = {};
  let healthy = true;

  try {
    // validate any API or store your Omi components depend on
    checks.store = 'ok';
  } catch {
    checks.store = 'error';
    healthy = false;
  }

  res.status(healthy ? 200 : 503).json({
    status: healthy ? 'ok' : 'degraded',
    checks,
    timestamp: new Date().toISOString(),
  });
});

Returning 503 on failure lets Vigilmon detect outages without parsing the body.


Step 2: Set up an HTTP monitor in Vigilmon

Deploy your Omi app and connect it to Vigilmon:

  1. Sign up at vigilmon.online — free, no card required
  2. Click New Monitor → HTTP
  3. URL: https://yourapp.example.com/health
  4. Check interval: 1 minute (paid) or 5 minutes (free)
  5. Expected status: 200
  6. Save

Vigilmon probes from multiple global regions. If /health returns anything other than 200 or times out, you get alerted immediately.


Step 3: Add a keyword monitor for your Omi app root

Your health endpoint watches the server. A keyword monitor checks that Omi actually mounts and renders its custom elements — essential for catching JS bundle errors or CDN failures.

In Vigilmon:

  1. Click New Monitor → Keyword
  2. URL: https://yourapp.example.com/
  3. Keyword: your root component tag name (e.g. my-app) or a static heading in your page template
  4. Match type: Contains
  5. Expected status: 200
  6. Save

A broken Omi bundle can leave the server healthy while components fail silently — the keyword monitor exposes that gap.


Step 4: Configure alerts

Go to Notifications → New Channel in Vigilmon and pick your channel:

Slack:

  1. Create an incoming webhook at api.slack.com/apps
  2. Paste the URL into Vigilmon's Slack channel config
  3. Enable it on both monitors

Email:

  1. Add your email address as a notification channel
  2. Enable it on both monitors

When your Omi app goes down:

🔴 DOWN: yourapp.example.com/health
Status: 503
Region: AP-Southeast
3 minutes ago

When it recovers:

✅ RECOVERED: yourapp.example.com/health
Downtime: 5 minutes

Enable both Slack and email for critical production apps.


Step 5: Heartbeat monitoring for scheduled tasks

If your Omi app is backed by a data-sync job, cron-triggered API refresh, or scheduled build, HTTP monitoring won't detect a silent failure there. Pin a Vigilmon heartbeat to it:

// scripts/sync.js
async function syncData() {
  // your data synchronization logic
  console.log('Sync complete');

  const heartbeatUrl = process.env.VIGILMON_SYNC_HEARTBEAT;
  if (heartbeatUrl) {
    await fetch(heartbeatUrl);
  }
}

syncData().catch((err) => {
  console.error('Sync failed:', err);
  process.exit(1);
});

In Vigilmon:

  1. Click New Monitor → Heartbeat
  2. Set the interval to match your job schedule
  3. Copy the ping URL
  4. Set VIGILMON_SYNC_HEARTBEAT=<url> in your environment

If the job misses a run or throws, Vigilmon alerts you after one missed interval.


Step 6: Public status page

Go to Status Pages → New Status Page in Vigilmon, add your monitors, and publish. Share the URL in your docs or error screens:

Service unavailable. Check our status: https://status.yourapp.example.com

Each monitor also generates a live badge:

![App Status](https://vigilmon.online/badge/your-monitor-slug)

What you've built

| What | How | |------|-----| | Health endpoint | Express route at /health | | HTTP uptime check | Vigilmon HTTP monitor | | Component render check | Vigilmon keyword monitor | | Slack/email alerts | Vigilmon notification channels | | Job monitoring | Heartbeat ping in scheduled script | | Status page | Vigilmon public status page |

Omi brings a unified component model. Now your production monitoring is just as unified.


Next steps

  • Monitor any API routes your Omi components call directly
  • Track response time trends — Vigilmon charts latency over time so gradual slowdowns are visible before they become outages
  • Add heartbeats for every background job that feeds data to your components

Get started free at vigilmon.online.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →