DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Your Deno Deploy Application with Vigilmon

How to Monitor Your Deno Deploy Application with Vigilmon

Deno Deploy runs your TypeScript/JavaScript at the edge — globally distributed, zero cold starts. But "serverless" doesn't mean "worry-free." Deployments can fail, functions can time out, and edge regions can have issues. Here's how to monitor your Deno Deploy app with Vigilmon.

Why Deno Deploy Needs Monitoring

Deno Deploy is managed infrastructure, but that doesn't mean it can't fail:

  • Deployment failures: A bad deploy silently serves stale code or errors
  • Function errors: Edge functions can throw on runtime errors
  • Regional degradation: Issues in specific regions affect users there
  • External dependency failures: If your DB or API is down, your function fails
  • Quota limits: Exceeding request limits causes 429 errors

External monitoring catches all of these from the user's perspective.

Add a Health Check Handler

For a Deno Deploy application using the standard Deno.serve API:

Deno.serve((req) => {
  const url = new URL(req.url);

  if (url.pathname === '/health') {
    return Response.json({
      status: 'ok',
      runtime: 'deno-deploy',
      version: Deno.version.deno,
      timestamp: new Date().toISOString()
    });
  }

  // Your app logic here
  return new Response('Hello World');
});
Enter fullscreen mode Exit fullscreen mode

For Fresh framework (Deno's full-stack web framework):

// routes/health.ts
import { Handlers } from '$fresh/server.ts';

export const handler: Handlers = {
  GET(_req, _ctx) {
    return Response.json({
      status: 'ok',
      timestamp: new Date().toISOString()
    });
  }
};
Enter fullscreen mode Exit fullscreen mode

For Hono on Deno Deploy:

import { Hono } from 'npm:hono';

const app = new Hono();

app.get('/health', (c) => {
  return c.json({ status: 'ok', runtime: 'deno' });
});

Deno.serve(app.fetch);
Enter fullscreen mode Exit fullscreen mode

Configure Vigilmon

  1. Go to vigilmon.online
  2. Click Add Monitor
  3. Set:
    • URL: https://your-app.deno.dev/health
    • Check interval: 1 minute
    • Expected status: 200
    • Keyword check: "status":"ok"
  4. Save

Vigilmon will probe your Deno Deploy app every 60 seconds from multiple regions and alert you the moment it returns a non-200 response or the keyword check fails.

Custom Domain Monitoring

If you're using a custom domain with Deno Deploy:

https://api.yourapp.com/health
Enter fullscreen mode Exit fullscreen mode

Vigilmon will also monitor the SSL certificate on your custom domain — alerting you 30 days before expiry.

Multi-Region Awareness

Deno Deploy serves from 35+ edge regions. Vigilmon's multi-region probes verify your app is reachable from different geographic locations. Configure monitors from:

  • North America
  • Europe
  • Asia-Pacific

If only one region shows failures, it might be a Deno Deploy regional issue rather than your code.

Database Connectivity Check

If your Deno Deploy function depends on a database (like Deno KV, Neon, or PlanetScale), check connectivity in your health endpoint:

import { createClient } from 'npm:@libsql/client';

Deno.serve(async (req) => {
  const url = new URL(req.url);

  if (url.pathname === '/health') {
    try {
      const db = createClient({
        url: Deno.env.get('DATABASE_URL')!
      });
      await db.execute('SELECT 1');
      return Response.json({ status: 'ok', db: 'connected' });
    } catch (err) {
      return Response.json(
        { status: 'error', db: 'disconnected', error: err.message },
        { status: 503 }
      );
    }
  }

  return new Response('OK');
});
Enter fullscreen mode Exit fullscreen mode

Response Time Alerts

Deno Deploy has near-zero cold starts. Set aggressive response time alerts:

  • Warning: > 500ms (something is degraded)
  • Critical: > 2000ms (likely external dependency issue)

Summary

Deno Deploy takes care of the infrastructure, but you need external monitoring to know when your app isn't responding correctly. Vigilmon gives you 60-second uptime checks from multiple regions, instant alerts, SSL monitoring, and a public status page.

Start free at vigilmon.online — 5 minutes to set up.

Top comments (0)