Skip to main content
Already using Nightwatch and not ready to fully switch? Run both agents side by side. In parallel mode the Nightwatch SDK in your app sends every record twice: once to the Nightwatch agent, exactly as before, and once to the NightOwl agent.

1. Add the parallel settings before you install

Add these to .env before composer require nightowl/agent. The package takes over Nightwatch’s collector as soon as it’s installed, and until NIGHTOWL_PARALLEL_WITH_NIGHTWATCH=true is set it runs standalone, where Nightwatch’s own copy is no longer sent.
NIGHTWATCH_TOKEN is used by the Nightwatch collector to authenticate outbound telemetry. NIGHTOWL_TOKEN is the token from the NightOwl dashboard. The NightOwl agent uses it for payload authentication and health reporting. NIGHTOWL_APP_ID is the connected-app ID shown alongside the token. The agent embeds it in alert payloads so issue links resolve to this app.
Then install and set up NightOwl as in the quickstart. The service provider sees the flag and wraps Nightwatch’s ingest so records go to both agents. Records written while your app boots, in any service provider’s boot(), reach both agents too. If you cache configuration, run php artisan config:cache after changing .env, and restart your queue workers and Octane (or reload PHP-FPM) so every process picks up the new values. With a cached config, .env changes have no effect until you do.

2. Run both agents

In production, give each its own supervisor program (see Production deployment). If a NightOwl agent was already running before you set NIGHTOWL_AGENT_PORT=2410, restart it: the agent reads its port only when it starts. Both agents receive the same telemetry. If one goes down, the other keeps running.

Where each copy is sent

Each copy has its own address setting, and NightOwl reads only its own: NightOwl never reads NIGHTWATCH_INGEST_URI. If your Nightwatch agent runs in another container or on another host and you point the app at it with NIGHTWATCH_INGEST_URI, set NIGHTOWL_INGEST_URI to the NightOwl agent’s address as well. Otherwise NightOwl’s copy goes to 127.0.0.1 on the app’s own machine, where nothing listens, and is dropped. The same applies after you switch: in standalone mode Nightwatch’s ingest address is ignored entirely. See Dedicated monitoring server for running the NightOwl agent on another host.

Switching fully to NightOwl

Keep the NightOwl agent where it is, on port 2410, and change only the app:
  1. Set NIGHTOWL_PARALLEL_WITH_NIGHTWATCH=false (or remove the line). Leave NIGHTOWL_AGENT_PORT=2410 as it is.
  2. Let the app pick up the change: php artisan config:cache if you cache configuration, then restart your queue workers and Octane, or reload PHP-FPM.
  3. Stop nightwatch:agent and remove it from your supervisor.
The NightOwl agent keeps listening on 2410 the whole time and needs no restart, so nothing is dropped during the switch. From then on the app sends only NightOwl’s copy. Moving NightOwl to port 2407 afterwards is optional. It means changing NIGHTOWL_AGENT_PORT for both the agent and the app and restarting the agent, and anything your app sends while no agent listens on the new port is lost. Stop nightwatch:agent first, or the NightOwl agent can’t bind 2407.