nightowl / agent
NightOwl monitoring agent — collects telemetry from laravel/nightwatch and writes to PostgreSQL
Requires
- php: ^8.2
- ext-pdo_pgsql: *
- ext-pdo_sqlite: *
- laravel/framework: ^11.0|^12.0
- laravel/nightwatch: ^1.26
- react/datagram: ^1.10
- react/event-loop: ^1.5
- react/http: ^1.9
- react/socket: ^1.15
Requires (Dev)
- laravel/boost: ^2.3
- mockery/mockery: ^1.6
- phpunit/phpunit: ^11.5
Suggests
- ext-zlib: Required for gzip decompression of compressed payloads
README
NightOwl Agent
Self-hosted Laravel monitoring agent. Drop-in Nightwatch alternative, open-source.
What is this?
NightOwl is an open-source Laravel monitoring agent paired with a closed-source hosted dashboard. The agent runs inside your app, buffers telemetry locally, and drains directly into your own PostgreSQL database — your request data never touches our servers. The dashboard at usenightowl.com connects to your database with credentials you control to render the monitoring UI.
Install
composer require nightowl/agent php artisan nightowl:install
Sign up and create an app to get your agent token: usenightowl.com/signup
Full installation guide: docs.usenightowl.com
Architecture
Your Laravel app Your infrastructure
┌──────────────────┐ TCP ┌──────────────────────────────┐
│ laravel/ │──2407────▶│ NightOwl Agent (ReactPHP) │
│ nightwatch │ │ ├─ SQLite WAL buffer │
└──────────────────┘ │ └─ pcntl drain workers │
│ │ │
│ │ COPY protocol │
│ ▼ │
│ PostgreSQL (yours) │
└──────────────────────────────┘
▲
│ reads via your creds
┌──────────┴──────────┐
│ NightOwl Dashboard │
│ (hosted, closed) │
└─────────────────────┘
13,400 payloads/s on a single instance — ReactPHP non-blocking TCP ingest, SQLite WAL buffering, PostgreSQL
COPYdrain withsynchronous_commit = off.
Features
- Requests — durations, status codes, routes, P95, slow endpoints
- Jobs — queue latency, attempts, failures, per-queue breakdowns
- Queries — N+1 detection, slow queries, per-request SQL timelines
- Exceptions — fingerprinted groups, stack traces, assignees, resolve/ignore
- Logs — level filtering, context metadata, per-request log streams
- Users — request and exception counts per authenticated user
- Alerts — Email (BYO SMTP), Webhook (HMAC), Slack, Discord
- Host metrics — CPU, memory, load average
- Agent health — ingest/drain rates, back-pressure, 19 diagnosis rules
Requirements
- PHP 8.2+ (with
pdo_pgsql,pdo_sqlite;pcntl+posixfor the async driver) - PostgreSQL 14+
- Laravel 11 or 12
- Redis — optional, only if your app already uses it for queues/cache
Self-hosting
The agent writes telemetry directly to your PostgreSQL database, never to ours. The only data the agent sends to NightOwl is agent/host health (ingest rates, buffer depth, CPU/memory) — zero request, query, or exception data leaves your infrastructure. The dashboard is hosted but connects to your DB using credentials you provided, which you can rotate or revoke at any time.
Contributing
Contributions are welcome. See CONTRIBUTING.md for setup, test suite structure, and conventions. Bug reports and feature requests go through GitHub Issues.
License
MIT — use it, fork it, ship it.
Related
- 🦉 Dashboard — usenightowl.com/signup
- 📖 Docs — docs.usenightowl.com
- 🌐 Website — usenightowl.com
