DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Your Directus Instance with Vigilmon

Directus is an open-source data platform and headless CMS that wraps any SQL database in a REST and GraphQL API. Whether you're running Directus on a VPS, Railway, or using Directus Cloud, you need uptime monitoring. Here's how to set it up with Vigilmon.

Directus Health Endpoint

Directus ships with a built-in health check endpoint:

GET /server/health
Enter fullscreen mode Exit fullscreen mode

This returns a detailed health response:

{
  "status": "ok",
  "releaseId": "10.x.x",
  "checks": {
    "node:version": [{"status": "pass"}],
    "env:version": [{"status": "pass"}],
    "storage:local": [{"status": "pass"}],
    "database": [{"status": "pass"}]
  }
}
Enter fullscreen mode Exit fullscreen mode

This is the perfect endpoint for Vigilmon to monitor — it checks Node.js, environment, storage, and database connectivity in one request.

Quick Setup

  1. Confirm your health endpoint works:
curl https://your-directus-instance.com/server/health
# Should return {"status":"ok",...}
Enter fullscreen mode Exit fullscreen mode
  1. Sign up at vigilmon.online (free tier covers 5 monitors)

  2. Create a monitor:

Setting Value
URL https://your-directus-instance.com/server/health
Method GET
Interval 60 seconds
Expected status 200
Keyword "ok"
  1. Add your email and save.

Done — Vigilmon now checks your Directus instance every 60 seconds.

Self-Hosted Directus (Docker)

If running Directus via Docker:

# docker-compose.yml
services:
  directus:
    image: directus/directus:latest
    ports:
      - "8055:8055"
    environment:
      KEY: 'your-secret-key'
      SECRET: 'your-secret-secret'
      DB_CLIENT: postgres
      DB_HOST: database
      DB_DATABASE: directus
      DB_USER: directus
      DB_PASSWORD: directus
    healthcheck:
      test: ["CMD", "wget", "-O", "/dev/null", "http://localhost:8055/server/health"]
      interval: 30s
      timeout: 10s
      retries: 3
Enter fullscreen mode Exit fullscreen mode

The Docker healthcheck is for container orchestration. You still need Vigilmon for external alerting — internal healthchecks don't notify you, they just restart the container.

Monitoring Directus Behind a Reverse Proxy

If Directus is behind Nginx or Caddy, make sure the health endpoint is accessible:

Nginx config:

location /server/health {
    proxy_pass http://directus:8055/server/health;
    # Don't add auth here — health should be public
}
Enter fullscreen mode Exit fullscreen mode

Caddy:

reverse_proxy /server/health directus:8055
Enter fullscreen mode Exit fullscreen mode

Test from outside your network before adding to Vigilmon:

curl https://cms.yourdomain.com/server/health
Enter fullscreen mode Exit fullscreen mode

Rate Limiting Considerations

Directus has built-in rate limiting. The health endpoint is typically exempt, but if you've configured aggressive rate limits, whitelist the check frequency:

# .env
RATE_LIMITER_ENABLED=true
RATE_LIMITER_POINTS=200
RATE_LIMITER_DURATION=60
Enter fullscreen mode Exit fullscreen mode

Vigilmon makes one request per 60 seconds — well within any reasonable rate limit.

Monitoring Directus Cloud

For Directus Cloud instances, use your project URL:

https://your-project.directus.app/server/health
Enter fullscreen mode Exit fullscreen mode

Since Directus Cloud manages infrastructure, focus your monitoring on:

  1. The health endpoint (catches application-level failures)
  2. A specific API route that queries your data (catches data layer issues)

Example data endpoint check:

URL: https://your-project.directus.app/items/posts?limit=1
Method: GET
Headers: Authorization: Bearer your-static-token
Expected status: 200
Enter fullscreen mode Exit fullscreen mode

Use a static read-only API token for this check.

Setting Up a Read-Only Monitoring Token

Don't use your admin token for monitoring. Create a dedicated monitoring user:

  1. Directus Admin → Settings → Users → Create user
  2. Role: create a "Monitoring" role with read-only access to one collection
  3. Generate a static token for this user (User profile → Token)

Add this token to your Vigilmon monitor as a custom header:

Authorization: Bearer your-monitoring-token
Enter fullscreen mode Exit fullscreen mode

What Breaks When Directus Goes Down

  • CMS editors can't publish or update content
  • Front-end apps get 502/503 errors on content API calls
  • Webhooks stop firing (no content updates pushed to subscribers)
  • File uploads fail
  • Any app using Directus as an auth provider breaks login

Alerting Setup

For a content team:

  • Email to the site administrator (free on Vigilmon)
  • Slack webhook to #cms-status for larger teams

For API-dependent production apps, consider setting up a status page (Vigilmon paid) to communicate outages to stakeholders.

Summary

Directus monitoring checklist:

  • [ ] Verify /server/health returns {"status":"ok"}
  • [ ] Create Vigilmon monitor with keyword check for "ok"
  • [ ] Set up email or Slack alert
  • [ ] Optional: add second monitor using a read-only API token

Monitor your Directus instance free with Vigilmon →

Top comments (0)