DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Directus APIs and Admin UI with Vigilmon

How to Monitor Directus APIs and Admin UI with Vigilmon

Directus is a headless CMS and data platform that turns any SQL database into a REST and GraphQL API. It's popular for content management, internal tools, and as a backend for modern web apps. When Directus goes down, every downstream application that depends on its API stops working too.

Here's how to set up external monitoring for Directus with Vigilmon.

Directus's Built-In Health Endpoint

Directus ships with a health endpoint at:


GET /server/health

Response when healthy:
json
{
"status": "ok"
}

Response when something is wrong:
json
{
"status": "error",
"errors": [...]
}

This is exactly what Vigilmon needs. The endpoint checks Directus's internal services including the database connection, cache layer, and file storage - not just whether the HTTP server is running.

Setting Up Vigilmon for Directus

  1. Sign up at vigilmon.online
  2. Add a new monitor
  3. Select HTTP(S)
  4. URL: https://your-directus-domain.com/server/health
  5. Method: GET
  6. Keyword check: "status":"ok" - this ensures Directus's health check fully passes
  7. Check interval: 1 minute for production
  8. Alert channels: Configure email, Slack, or webhook

Vigilmon checks from multiple geographic regions, so you only get alerted when a failure is confirmed across locations - not on transient network glitches.

Monitoring the Directus Admin UI

The API health check covers backend functionality. Also monitor the admin UI separately to catch frontend delivery failures:

  1. Add another monitor
  2. URL: https://your-directus-domain.com/admin
  3. Keyword check: Directus or another string that appears in the admin page
  4. Check interval: 5 minutes (admin UI is less critical than the API for most setups)

Monitoring Key API Collections

For business-critical collections, you can monitor specific API endpoints:


GET /items/your_collection?limit=1

This requires an API token. In Vigilmon, you can add custom request headers:

  • Header: Authorization
  • Value: Bearer your_static_token

Create a dedicated read-only Directus user for monitoring purposes and generate a token with minimal permissions. Don't use your admin token for monitoring checks.

Directus Deployment: What Changes Your Monitoring Approach

Docker Compose on a VPS: Monitor the public domain behind your reverse proxy (nginx/Caddy). The health check goes through the full stack.

Railway or Render: Use the assigned domain or custom domain. Health check works the same way.

Directus Cloud: Directus Cloud manages the infrastructure. Monitor your Directus Cloud project URL - the health endpoint is still available.

SSL Certificate Monitoring

Add a separate SSL monitor for your Directus domain:

  1. Add a new monitor
  2. Select SSL Certificate
  3. Enter your Directus domain
  4. Alert threshold: 14 days before expiry

Common Failure Scenarios Vigilmon Catches

Database connection dropped: Directus's /server/health returns "status":"error" when it can't reach the database. Vigilmon's keyword check catches this.

Out-of-memory crash: The Directus process exits. Vigilmon's HTTP check fails immediately - no response means down.

Failed deployment: New version fails to start. Vigilmon alerts within 1 minute.

Reverse proxy misconfiguration: nginx returns 502 or serves a config error page. Vigilmon's status code check fails.

Cache layer failure: Directus reports an error in the health response. Keyword check catches it even if the HTTP status is 200.

Heartbeat Monitoring for Directus Flows

Directus Flows (automation) can run scheduled tasks. If you have critical scheduled flows, add heartbeat monitoring:

  1. Add a Directus Flow operation that makes an HTTP request to Vigilmon's heartbeat URL
  2. Configure it as the last step in your scheduled flow
  3. Vigilmon alerts if the heartbeat doesn't arrive on schedule


POST https://vigilmon.online/hb/your-heartbeat-id

Recommended Monitoring Setup

Monitor URL Check
API Health /server/health "status":"ok"
Admin UI /admin Status 200
SSL your domain Valid, >14 days
Critical Collections /items/posts?limit=1 Status 200

This gives you visibility across the full Directus stack with alerts routed to wherever your team responds fastest.

Start monitoring your Directus instance free at vigilmon.online - setup takes under 5 minutes.

Top comments (0)