nightowl/agent
NightOwl Agent is a lightweight Laravel package that instruments your application and streams request, query, job, and exception telemetry to a NightOwl monitoring server, giving you performance and error insights with minimal setup and overhead.
composer require nightowl/agent. Because the package has ~0 dependents and a single maintainer, pin the version ("nightowl/agent": "0.x.*") rather than floating *.php artisan vendor:publish --provider="NightOwl\\Agent\\AgentServiceProvider" (verify the exact provider/tag with php artisan vendor:publish interactively — the tag name is the fastest way to discover what's publishable). Open config/nightowl.php before writing any code; connection, batch size, and retention settings almost always live there.NIGHTOWL_DB_* or a dedicated pgsql connection in config/database.php) and run php artisan migrate. Migrations create the telemetry tables the dashboard reads from.php artisan list | grep -i nightowl. You are looking for a long-running ingest/worker command — that command, not a middleware or facade, is the actual product.laravel/nightwatch locally, run the ingest command in the foreground with -vvv, hit a route, then SELECT * FROM <telemetry table> ORDER BY created_at DESC LIMIT 5;. If rows appear, the hard part is done; everything after that is operations.artisan serve. The agent is a daemon. Run it under Supervisor (numprocs=1, autorestart=true, stopwaitsecs generous enough to flush a batch) or a systemd unit. Never run it from a web request or a scheduled job that might overlap.app/environment discriminator (usually a config value injected at insert) so one Postgres cluster can serve staging and production dashboards without cross-contamination. Prefer separate schemas over separate databases — cheaper to operate, same isolation for dashboards.INSERT-only Postgres role and the dashboard a SELECT-only role. This makes it obvious in pg_stat_activity which process is doing what and limits blast radius.->where('created_at', '<', now()->subDays(14))->delete() in chunks, or the package's prune command if one exists). Telemetry tables grow monotonically; without this you will hit disk pressure within weeks on a busy app.NIGHTOWL_ENABLED=false) and assert it in phpunit.xml. Tests should never attempt a Postgres connection through the agent — that turns a fast suite into a flaky one.php artisan nightowl:restart (or supervisorctl restart nightowl:*) to your deploy script, and remember that opcache/config caches are read at boot, not per-message.composer update on one side is a common source of empty dashboards.(app, created_at) and whatever the dashboard filters on. Check with EXPLAIN ANALYZE when the dashboard gets sluggish — the agent's inserts are cheap, the dashboard's scans are not.timezone => 'UTC' on the connection config. Mixing now() in app timezone with Postgres timestamptz produces dashboards that look correct for you and wrong for everyone else.jsonb, prune or downsample them before they dominate table size. pg_total_relation_size() on the telemetry table is the metric to watch.sslmode=require for managed Postgres (RDS/Neon/Supabase), and make sure the agent host has egress — the agent runs on the app server, not next to the DB, so it inherits every firewall rule in between.Event::listen hooks if the package dispatches pre/post-write events. Filtering at the source is far cheaper than filtering at write or query time.How can I help you explore Laravel packages today?