Download the PHP package nightowl/agent without Composer

On this page you can find all versions of the php package nightowl/agent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package agent

NightOwl Agent

Open-source Laravel monitoring agent. Captures telemetry from laravel/nightwatch and drains it into a PostgreSQL database you control.

Packagist Version PHP 8.2+ Tests


What is this?

NightOwl Agent is an MIT-licensed Laravel package that:

  1. Sits in front of laravel/nightwatch — Laravel's official observability SDK. Nightwatch already does the hard part: instrumenting all 12 record types — requests, queries, jobs, exceptions, commands, cache events, mail, notifications, outgoing HTTP, scheduled tasks, logs, users. The agent receives those payloads over a local TCP socket.
  2. Buffers them in a local SQLite WAL with non-blocking ReactPHP ingest. An ingest-only benchmark accepted 13,400 payloads/s on a single instance; see the throughput guide for drain numbers.
  3. Drains them into a PostgreSQL database you provision via the COPY protocol. Telemetry never leaves your network.

All tables are prefixed nightowl_ and the schema is documented. You're free to query the data with psql, point Metabase at it, or build your own UI on top — Livewire, Next.js, whatever.

Run it standalone

This package is fully usable on its own. Point it at a PostgreSQL database you control and you have a self-hosted Laravel APM:

Minimal .env (PostgreSQL credentials — that's it):

You don't need to wire up Nightwatch's transport — the service provider automatically redirects its ingest to the local agent on 127.0.0.1:2407. For a local-only setup you also don't need any token; the agent only enforces one if you set NIGHTOWL_TOKEN (useful when the agent listens on something other than loopback). Without a token the agent also sends nothing to NightOwl's platform (see Data ownership & privacy).

UDP ingest on port 2408 is off unless you set NIGHTOWL_ENABLE_UDP=true.

Tables fill up. Run any SQL you want against them.

Updating

The migrate step happens on boot: when the agent starts and its schema is behind, it applies the pending migrations itself before it accepts traffic, so schema changes arrive with the code that needs them. That schema run is bounded by NIGHTOWL_AUTO_MIGRATE_TIMEOUT (300s) and executes in a child process the agent kills at the deadline — a lock on your database can never leave the ingest port unbound. If it doesn't finish, the agent starts anyway on the old schema and retries next boot. Long rollup backfills continue in a detached background process (log: storage/logs/nightowl-boot-migrate.log) and are retried on a later boot if one dies partway.

The agent does not restart itself. A running process keeps the code it booted with, so until you restart it the update isn't live. To make that visible rather than silent, the daemon checks vendor/composer/installed.php every few minutes and logs a warning once it sees a newer version on disk than the one it's running:

Restarting is deliberately left to you: whether a supervisor would bring the agent back after a self-initiated exit depends on configuration the agent can't verify, and being wrong about that leaves you with no agent at all rather than a slightly stale one.

Running nightowl:migrate in your deploy pipeline is still worthwhile — the boot-time run is the safety net, and a pipeline run does the rollup backfill where its latency is visible.

Opt out with NIGHTOWL_AUTO_MIGRATE=false (e.g. a DB role without DDL rights) or NIGHTOWL_UPDATE_CHECK=false.

Disabling NightOwl

Set NIGHTOWL_ENABLED=false to make the package fully inert — the Nightwatch ingest hook is not wired (no telemetry is collected or transmitted) and the migrations are not registered. The most common use is turning it off in your test suite so tests don't pay the ingest overhead or require the nightowl database to exist:

nightowl:install runs its migrations regardless of this flag (it's an explicit opt-in), so you can still install while the switch is off.

Sharing one database across environments

NightOwl stamps an environment column (your APP_ENV) on every row, so several app environments (local, staging, production) can point at one NightOwl database and be filtered apart in the dashboard. The data is partitioned by environment; the nightowl_* tables are shared.

nightowl:install and nightowl:migrate track their migration history inside the NightOwl database, so they're idempotent across environments. Run the schema sync as part of each deploy:

The first environment to deploy creates the tables, the rest are no-ops, and upgrades' new migrations apply on whichever environment deploys first. No "owner" environment and no flags. A database that already has the tables but no NightOwl migration history (e.g. created by an older version or by your app's php artisan migrate) is adopted as a baseline, so you never hit relation "nightowl_requests" already exists.

By default these migrations are not bundled into your app's php artisan migrate. If you'd rather run them that way (single-database setups only — it tracks history in your primary database and must not be combined with nightowl:install), set NIGHTOWL_RUN_MIGRATIONS=true.

What you get out of the box

These features run in the agent process, against your Postgres.

Architecture

ReactPHP non-blocking TCP ingest, SQLite WAL buffering, PostgreSQL COPY drain with synchronous_commit = off. An ingest-only benchmark accepted 13,400 payloads/s on a single instance. In a July 2026 load test, one drain worker wrote about 2,500 payloads/s to PostgreSQL. Details in the throughput guide.

What the agent collects

Whatever Nightwatch emits, the agent persists. Each row carries duration (microseconds), environment, deploy, and the request/job correlation IDs Nightwatch attaches.

P95s, N+1 detection, slow-query rankings, request timelines, etc. are queries you write against these tables.

Requirements

Data ownership & privacy

The agent writes telemetry directly to your PostgreSQL database. Request, query, exception and log data is never sent to NightOwl.

When the agent has a token (NIGHTOWL_TOKEN, or NIGHTWATCH_TOKEN as a fallback), it also sends two things to the NightOwl platform at NIGHTOWL_API_URL (default https://api.usenightowl.com):

Without a token, neither is sent. The alerts the agent sends go straight to the channels you configure (your SMTP server, Slack, Discord, your webhooks).

The schema is documented and stable, so your data stays usable even if you stop running the agent.

Optional: the hosted dashboard

If you'd rather not build and maintain a UI, usenightowl.com is a managed service that connects to your Postgres with credentials you supply (and can rotate or revoke at any time). It adds an issue lifecycle UI (resolve / ignore / reopen, assignees, comments, activity timeline), alerts for those state transitions, teams, and an MCP server for AI tools. The agent itself stays MIT and works the same with or without it.

Full guide: docs.usenightowl.com

Contributing

Contributions are welcome. See GitHub Issues.

License

MIT.

Related


All versions of agent with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-pdo_pgsql Version *
ext-pdo_sqlite Version *
laravel/framework Version ^11.0|^12.0|^13.0
laravel/nightwatch Version ^1.26
react/datagram Version ^1.10
react/event-loop Version ^1.5
react/socket Version ^1.15
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nightowl/agent contains the following files

Loading the files please wait ...