DEV Community

Vigilmon
Vigilmon

Posted on Originally published at vigilmon.online

How to Monitor Your Encore.ts Application with Vigilmon

Encore.ts is a TypeScript backend framework that handles infrastructure provisioning, API generation, and cloud deployment automatically. It's designed to eliminate boilerplate so you can focus on business logic — but when your Encore.ts service goes down, you still need external monitoring to know about it.

This guide covers how to set up uptime monitoring for an Encore.ts application using Vigilmon.

Why Encore.ts Needs External Monitoring

Encore provides:

  • Automatic API documentation and type-safe clients
  • Built-in distributed tracing
  • Cloud deployment to AWS or GCP
  • Development dashboard for local debugging

But Encore's built-in observability is inward-facing — it shows you what's happening inside your service. Vigilmon adds the outside-in view: checking whether your endpoints are reachable by the public, just like your users.

Step 1: Identify Your Encore.ts Endpoints

Encore.ts uses service-based routing. Your endpoints are defined with api() calls:

import { api } from 'encore.dev/api'

export const getUser = api(
  { expose: true, method: 'GET', path: '/users/:id' },
  async ({ id }: { id: string }) => {
    return { id, name: 'Jane Doe' }
  }
)
Enter fullscreen mode Exit fullscreen mode

Exposed endpoints (expose: true) are publicly reachable. These are the ones to monitor.

Step 2: Add a Health Check Endpoint

Add a dedicated health endpoint to your Encore.ts service:

import { api } from 'encore.dev/api'

export const health = api(
  { expose: true, auth: false, method: 'GET', path: '/health' },
  async () => {
    return {
      status: 'ok',
      timestamp: new Date().toISOString(),
      service: 'your-service-name'
    }
  }
)
Enter fullscreen mode Exit fullscreen mode

This endpoint:

  • Requires no authentication
  • Returns quickly (no database calls)
  • Gives Vigilmon a reliable target to ping

Step 3: Set Up Vigilmon Monitors

  1. Go to vigilmon.online and sign in
  2. Add a monitor for your health endpoint:
    • URL: https://your-app.encoreapi.com/health (or your custom domain)
    • Method: GET
    • Expected status: 200
    • Interval: 1 minute
    • Alert after: 1-2 failures
  3. Add monitors for critical business endpoints:
    • GET /users — list endpoint
    • GET /products — if applicable
    • Any revenue-critical API routes

Step 4: Find Your Encore.ts Deployment URL

For Encore Cloud deployments:

encore env list
# Shows your environments and their URLs
Enter fullscreen mode Exit fullscreen mode

Production is typically at https://[app-name]-[random].encoreapi.com.

If you've configured a custom domain, use that instead.

Step 5: Monitor Multiple Environments

Encore.ts encourages environment-per-branch development. Monitor each environment separately:

  • Production: https://prod.your-domain.com/health — critical alerts
  • Staging: https://staging.your-domain.com/health — lower urgency alerts

This catches broken deployments before they reach production.

Step 6: SSL Monitoring

If you're using a custom domain with your Encore.ts app:

  1. Open your monitor in Vigilmon
  2. Enable SSL certificate monitoring
  3. Set alert at 14 days before expiry

Encore Cloud manages certificates for encoreapi.com URLs, but custom domains need manual renewal monitoring.

Monitoring Encore.ts Services in a Microservice Setup

If you're running multiple Encore.ts services, add a monitor per service:

Service Health URL Interval
users /users/health 1 min
payments /payments/health 1 min
notifications /notifications/health 5 min

This lets you identify which service is failing rather than just knowing "something is down."

Alerting Configuration

For a TypeScript backend powering a production app, configure at minimum:

  • Email: to your on-call email or team inbox
  • Webhook to Slack: for team visibility

Add PagerDuty or OpsGenie for P0 services.

Summary

Encore.ts handles a lot of infrastructure complexity for you, but external uptime monitoring is still your responsibility. Vigilmon adds the outside-in health check in minutes.

Monitor your Encore.ts app at vigilmon.online.

Top comments (0)