Skip to main content
All configuration lives in config/nightowl.php after running php artisan nightowl:install. Most values are driven by environment variables — the defaults are tuned for a single-instance deployment doing up to a few thousand requests per second.

Database connection

VariableDefaultDescription
NIGHTOWL_DB_HOST127.0.0.1PostgreSQL host
NIGHTOWL_DB_PORT5432PostgreSQL port
NIGHTOWL_DB_DATABASEnightowlPostgreSQL database name
NIGHTOWL_DB_USERNAMEnightowlPostgreSQL username
NIGHTOWL_DB_PASSWORDnightowlPostgreSQL password
Use the same credentials you entered when creating the app in the dashboard — the hosted UI uses them to read the telemetry your agent wrote.

Agent runtime

VariableDefaultDescription
NIGHTOWL_AGENT_HOST127.0.0.1TCP host the agent binds to (use 0.0.0.0 or an LB VIP for multi-host)
NIGHTOWL_AGENT_PORT2407TCP port the agent listens on
NIGHTOWL_AGENT_DRIVERasyncServer driver (async or sync). async needs pcntl + posix
NIGHTOWL_SO_REUSEPORTfalseAllow multiple agents to bind the same port (Linux only)
NIGHTOWL_ENVIRONMENTAPP_ENVOverride APP_ENV for the environment column stamped on every row
See Running multiple instances for SO_REUSEPORT.

Authentication

VariableDescription
NIGHTWATCH_TOKENAgent token copied from the NightOwl dashboard (Settings → Agent token). The laravel/nightwatch SDK reads it to sign outbound telemetry; the NightOwl agent reads it to verify inbound payloads. For a standalone install this is the only token you need.
NIGHTOWL_TOKENOptional override used only in parallel mode, when NightOwl runs alongside Nightwatch’s hosted agent and each side needs a distinct token. When set, the NightOwl agent uses this for verification instead of NIGHTWATCH_TOKEN. Don’t set it for a standard install.
NIGHTOWL_APP_IDOptional connected-app ID (also shown in Settings). When set, webhook alerts embed a direct-link view_url and populate app_id in the payload — see alert channels.
For a standalone install, set NIGHTWATCH_TOKEN only. For parallel mode, set both: NIGHTWATCH_TOKEN is your Nightwatch token (what the SDK signs outbound telemetry with); NIGHTOWL_TOKEN is the separate token the NightOwl agent verifies against. Internally the agent reads NIGHTOWL_TOKEN when present and falls back to NIGHTWATCH_TOKEN otherwise.

Drain pipeline

VariableDefaultDescription
NIGHTOWL_DRAIN_WORKERS1Parallel drain worker processes (forked, atomic SQLite row claiming)
NIGHTOWL_DRAIN_BATCH_SIZE5000Rows per PostgreSQL COPY batch
NIGHTOWL_DRAIN_INTERVAL_MS100Drain loop sleep interval when the buffer is idle
NIGHTOWL_MAX_PENDING_ROWS100000Reject new payloads once the buffer hits this depth
NIGHTOWL_MAX_BUFFER_MEMORY268435456RSS ceiling (bytes) before back-pressure kicks in (default 256 MB)
See throughput tuning for how to size these.

Sampling

Exceptions and 5xx requests are always kept regardless of sample rate. When an entry point is sampled in, the entire trace (queries, cache, logs, etc.) is captured.
VariableDefaultDescription
NIGHTOWL_SAMPLE_RATE1.0Global sampling rate (1.0 = keep all)
NIGHTOWL_REQUEST_SAMPLE_RATEOverride sample rate for HTTP requests
NIGHTOWL_COMMAND_SAMPLE_RATEOverride sample rate for artisan commands
NIGHTOWL_SCHEDULED_TASK_SAMPLE_RATEOverride sample rate for scheduled tasks
See Filtering and context for the full recipe.

Redaction

VariableDefaultDescription
NIGHTOWL_REDACT_ENABLEDtrueRedact sensitive keys from payloads before writing
NIGHTOWL_REDACT_KEYSpassword,token,authorization,cookie,secret,api_keyComma-separated key names to redact. Matched case-insensitively. Overriding this replaces the full list — include password, token, etc. if you still want them scrubbed.
Redaction is enabled by default. Query-string parameters with these names are also scrubbed from any url / uri / endpoint / href field inside the payload. To capture raw credentials in telemetry for debugging (not recommended), set NIGHTOWL_REDACT_ENABLED=false.

Retention and caching

VariableDefaultDescription
NIGHTOWL_RETENTION_DAYS14Default for nightowl:prune --days=? — nothing is deleted until the command is run
NIGHTOWL_THRESHOLD_CACHE_TTL86400Seconds to cache performance thresholds (restart to pick up changes immediately)
Full retention and pruning strategy lives in Data management.

Parallel mode

VariableDefaultDescription
NIGHTOWL_PARALLEL_WITH_NIGHTWATCHfalseFan telemetry out to both Nightwatch and NightOwl simultaneously
See Running alongside Nightwatch.

Artisan commands

CommandDescription
nightowl:agentStart the monitoring agent
nightowl:installPublish config and run migrations
nightowl:pruneDelete monitoring data older than retention period
nightowl:clearTruncate all monitoring tables
nightowl:check-thresholdsPoll and dispatch threshold-breach notifications
The agent command accepts --driver=async|sync. async is the default and required for multi-worker drain; sync is a single-process fallback for hosts without pcntl/posix.