Laravel
← Back to all checks

Availability

Application health

Reads the health results your application reports about itself, such as disk space, queues or database connections, and alerts you when one fails or the app stops reporting.

This check is off by default. Enable it and set an endpoint under Active checks on the monitor.

How it works

Your application checks itself (disk space, database connections, queues, scheduled jobs, error rates, anything you like) and publishes the results on an endpoint. Every minute, we read that endpoint and alert you when a result is failing or warning.

The endpoint uses the Oh Dear application health format, which spatie/laravel-health serves out of the box:

{
  "finishedAt": 1760436000,
  "checkResults": [
    {"name": "UsedDiskSpace", "label": "Used disk space", "status": "ok", "notificationMessage": "", "shortSummary": "48%", "meta": {}}
  ]
}

status is ok, warning, failed, crashed or skipped. We send your secret in the oh-dear-health-check-secret header, so the endpoint can reject other callers. When finishedAt is older than the stale limit, your application has stopped running its checks.

Settings

Setting Default What it does
Endpoint — The URL of the health results.
Secret — Sent in the oh-dear-health-check-secret header.
Interval minutes 1 How often to read the endpoint.
Stale minutes 10 Warn when the results are older than this.
Timeout seconds 10 How long to wait for a response.

Statuses

Status Meaning
OK Every reported result is OK and the results are recent.
Warning A result is warning, or the results are older than the stale limit.
Failed A result is failing, or the endpoint is unreachable, rejects the secret or returns something that is not in the health format.

By default you are notified of warnings and failures.

Fixing common problems

  • The endpoint rejected the secret (401 or 403): copy the same secret into the application's configuration (for Laravel Health, OH_DEAR_HEALTH_CHECK_SECRET) and into this check.
  • Not in the health check format: the response must be JSON with finishedAt and checkResults. A login page or an HTML error page means the URL is wrong or protected.
  • Results are stale: the scheduler that runs the checks has stopped. With Laravel Health, make sure RunHealthChecksCommand is scheduled and the scheduler is running.