/status endpoint answers on the host where it runs. Both carry the same numbers.
Where to find it
In the dashboard, open your app and click Agent Health in the sidebar. It’s part of the Team and Agency plans, and it follows the plan of the team that owns the app. Every running agent sends a health report to NightOwl, every 30 seconds by default (NIGHTOWL_HEALTH_REPORT_INTERVAL), authenticated with NIGHTOWL_TOKEN. The page reads those reports, not your database, so it keeps working while your database is down: the other pages of the app switch to “Can’t reach your database”, and that page links back to Agent Health. It also stays open when the NightOwl tables aren’t installed yet, or when the dashboard’s database role can’t read them. While it’s open, the page refreshes every 15 seconds (every 8 when degraded, every 5 when critical), and the charts refresh every minute.
An agent without a token doesn’t report, and NIGHTOWL_HEALTH_REPORT_ENABLED=false turns the reports off. The sync driver (--driver=sync) never reports.
What the page shows
- Status banner.
HEALTHY,DEGRADEDorCRITICAL, the health score, and the time of the last report. When the newest report is more than two minutes old it adds “Data may be stale — agent may be offline”. - Instances. One row per running agent process, named
hostname:pid, with its health, Ingest/s (payloads accepted per second), Drain/s (buffered payloads written to PostgreSQL per second), PG Latency, Write Queue (pending rows as a share ofNIGHTOWL_MAX_PENDING_ROWS), CPU, Memory, Reject and Last Seen. An agent that hasn’t reported for 60 seconds drops off the list. With none left, the table reads “No active agent instances”. - Diagnoses. Each open or recently resolved problem, with its message, the recommended fix, the instance and a code. Filter by Open or Resolved, and by Critical, Warning or Info.
- Performance History. Four charts over the page’s time range: Throughput (all instances) with Ingest and Drain lines, Buffer (total pending), Postgres Latency (avg) and Health Score (worst instance).
How the health score works
Each agent scores itself every 10 seconds. It starts at 100 and loses 25 points for each critical diagnosis, 10 for each warning and 2 for each info, down to 0. A diagnosis counts once it has held for two checks in a row.
With several agents, the banner shows the worst case. If any agent is critical, the app is critical and shows the lowest score. Otherwise, if more than 30% of the agents are degraded or have stopped reporting, it’s degraded and shows the average score. Otherwise it’s healthy with the average. If every agent has been silent for more than three minutes, it’s critical.
Diagnoses you’re most likely to see
Every diagnosis on the page carries its own recommendation. These are the common ones:Health alerts
When a warning or critical diagnosis starts, the agent sends ahealth.degraded alert to your alert channels, and a health.recovered alert when it clears. Info diagnoses don’t alert. The agent sends these itself, from your server, to the enabled channels under Settings → Alerts that include those events.
Emails have a View agent health button that opens this page. Slack and Discord messages end with a “View agent health” link, and webhook payloads carry app_id and view_url. The link is built from NIGHTOWL_DASHBOARD_URL and NIGHTOWL_APP_ID. Without NIGHTOWL_APP_ID it opens the dashboard home.
The alert channels live in the same database the agent drains into, which may be the thing that’s down. So the agent saves the channel list next to its buffer, in storage/nightowl/agent-buffer.sqlite.alert-channels.json by default: about 5 seconds after it starts, every 15 minutes after that, and each time it sends a health alert. When the database can’t be reached, or doesn’t answer the channel query within 5 seconds (a migration holding a lock on the channel table, for example), it sends to that saved list and logs Could not read alert channels from the database (...). Using the saved list at .... If a refresh fails, the agent keeps the last saved list and logs Could not refresh the saved alert channel list at .... Only an agent that has never reached the database, with no list saved by an earlier run, has nothing to send to during an outage. An alert round or a refresh that is still running after 180 seconds is stopped, and the agent logs Health alert dispatch was stopped after 180s. The database or an alert channel did not answer. (or Alert channel refresh was stopped after 180s. ...). Later alerts go out as usual.
What to do when it’s unhealthy
- The drain can’t keep up. Raise
NIGHTOWL_DRAIN_WORKERS(1 to 16) and restart the agent. Each worker holds its own PostgreSQL connection, so check thatmax_connectionshas room. See Multiple instances. - PostgreSQL is slow. Check
pg_stat_activity, disk and CPU on the database server. See PostgreSQL sizing. - One agent isn’t enough. Run several. On one Linux host they share the ingest port automatically, each with its own buffer and health port. See Multiple instances.
- Nothing arrives at all. Check that
nightowl:agentis running under your supervisor, and thatNIGHTOWL_TOKENmatches on the app and the agent.
The /status endpoint
The agent also serves its numbers locally, on NIGHTOWL_HEALTH_PORT (default 2409):
The response also carries
uptime_seconds, agent_version, process and host metrics, and resolved_diagnoses. See Production deployment for health checks, Kubernetes probes, and which address the endpoint listens on.
Visibility from the host application
When the agent rejects a payload (back-pressure, a token mismatch, a malformed payload) or can’t be reached, thelaravel/nightwatch SDK in your application drops that batch and the request carries on: no retry, no build-up in memory. NightOwl writes a line to PHP’s error log, starting [NightOwl Support] MultiIngest, and passes the error to Nightwatch’s handler for unrecoverable exceptions. The Reject column on Agent Health shows the same thing from the agent’s side. To log it your own way, register a handler in AppServiceProvider::boot():
Raw metrics for external monitoring
For Prometheus, Datadog or a cron script,/status is the simplest source: it already combines every drain worker. The drain workers also write their own metrics next to the SQLite buffer, which the agent reads to build /status:
- One worker (the default).
storage/nightowl/agent-buffer.sqlite.drain-metrics.json - Several workers (
NIGHTOWL_DRAIN_WORKERSabove 1). One file per worker, numbered from 0:storage/nightowl/agent-buffer.sqlite.drain-metrics-{id}.json
*.drain-metrics*.json so you get every worker.