How to monitor Laravel

Monitor a Laravel app with the built-in /up route or Spatie's Laravel Health JSON endpoint, which Vigil reads check by check. Watch queue workers and the failed_jobs count, make the scheduler ping a heartbeat with pingOnSuccess, and send exceptions to a Sentry-compatible endpoint. The server agent watches PHP-FPM, Supervisor and the logs.

Updated · by PuzariCloud · commands checked against current releases

What can go wrong with Laravel

  • Queue workers stopped. queue:work died or was not restarted after a deploy (workers keep old code in memory until queue:restart). Jobs pile up or run stale code.
  • Failed jobs pile up. Jobs that exhaust their tries go to failed_jobs and stay there silently.
  • Scheduler not running. The single * * * * * php artisan schedule:run cron entry is missing on a new server, so every scheduled task stops at once.
  • Storage and cache. Wrong permissions on storage/, or a stale config:cache after changing .env, give 500s that only show in the log.
  • PHP-FPM saturated. All pm.max_children are busy; the FPM log says server reached pm.max_children setting and the web server returns 502/504.

The signals that matter, with alert thresholds

SignalAlert whenWhy it matters
Laravel Health checksany failed or warningDatabase, cache, disk, queue, schedule, per check.
Uptime of /up and key pagesnon-2xx twiceApp does not boot or serve.
failed_jobs count> 0 new per hourJobs giving up.
Scheduler heartbeatlateNo scheduled tasks run.
max_children warnings in the FPM loganyCapacity.
New exceptionsfirst occurrenceBugs.

Thresholds are starting points. Tune them after a week of data: an alert nobody acts on should be raised or removed.

How to check Laravel by hand

Environment, drivers and caches
php artisan about
Failed jobs
php artisan queue:failed
What is scheduled, and when
php artisan schedule:list
Workers under Supervisor, and Horizon
sudo supervisorctl status
php artisan horizon:status
FPM saturation
sudo grep max_children /var/log/php*-fpm.log | tail

How to watch Laravel with Vigil

  1. Install spatie/laravel-health, register its checks, expose its JSON results endpoint (or its Oh Dear endpoint) and create an App health monitor on it in New monitor. Vigil reads that format natively and sends a configured secret as oh-dear-health-check-secret. Each check alerts on its own.
  2. Add an Uptime monitor on /up (Laravel 11's built-in route) and on the pages that matter.
  3. Give the scheduler a heartbeat: create a Heartbeat and chain ->pingOnSuccess('https://puzaricloud.in/ping/<token>') on an important scheduled task (or on a trivial every-minute task to prove schedule:run itself runs).
  4. Install the server agent, add php8.3-fpm (your version) and supervisor to the services to watch, and the failed-jobs command below with the limit laravel_failed_jobs = 1.
  5. Create a project under Errors and set its DSN as SENTRY_LARAVEL_DSN for sentry/sentry-laravel. For traces, the OpenTelemetry PHP SDK sends to the OTLP endpoint (quick start).
/etc/vigil-agent.json (add to the existing keys)
{
  "commands": {
    "laravel_failed_jobs": "cd /var/www/app && php artisan tinker --execute=\"echo DB::table('failed_jobs')->count();\""
  },
  "log_watch": [
    {"name": "fpm_max_children", "path": "/var/log/php8.3-fpm.log", "pattern": "max_children"}
  ]
}

Every alert goes to the channels you pick: email, Slack, Telegram, Discord, Microsoft Teams, Pushover, webhooks or on-call paging. Failures are confirmed by a second check before anyone is woken up.

Laravel monitoring FAQ

Is /up enough?

It proves the framework boots, nothing more: it does not touch the database, cache or queue. Use it for uptime and Laravel Health for the dependencies.

How do I know the scheduler runs on every server?

Run it on one server only (or use onOneServer()), and give that a heartbeat. If you run it on several, one heartbeat per server tells you which one stopped.

Does Horizon change anything?

Horizon manages the workers and shows metrics. Watch the horizon process or Supervisor program, keep the failed-jobs limit, and add Horizon's status as a Laravel Health check.

Vigil by PuzariCloud

Watch Laravel without stitching five tools together

Uptime and API checks, heartbeats, server and database metrics, traces, errors and logs in one place, with one incident and one alert when something breaks. Every feature is on every plan, including Free.