What Cloud provides
| Layer | Cloud built-in | Still want APM for |
|---|---|---|
| Server metrics | CPU, memory, disk | Application-layer telemetry |
| Logs | Last N hours, basic viewer | Long retention, structured search |
| Queue workers | Worker status, failed_jobs UI | Per-class trending, p95 per job |
| Scheduled tasks | Last-run timestamps | Missed-run detection, duration trends |
| Database | Engine metrics (connections, CPU) | Per-query p95, N+1 detection |
| Exceptions | Appears in logs | Grouping, alerts, issue management |
Running NightOwl as a Cloud worker
Laravel Cloud supports worker processes via its application configuration:
laravel-cloud.yaml (illustrative)
workers:
- name: nightowl
command: php artisan nightowl:agent
replicas: 1
memory: 512MB
- name: queue
command: php artisan queue:work --queue=default --sleep=0 --tries=3
replicas: 2Point the agent at your PostgreSQL — either Cloud's managed instance or a separate DB. The latter keeps telemetry storage isolated from application hot-path queries.
Autoscaling + cold starts
Cloud scales app containers based on traffic. New containers go through a cold boot (bootstrapping Laravel, building config/route/view caches). Monitoring should distinguish cold-boot requests from steady-state:
app/Http/Middleware/TagContainerBoot.php
use Closure;
use Illuminate\Http\Request;
class TagContainerBoot
{
private static ?float $bootTime = null;
public function handle(Request $request, Closure $next)
{
if (self::$bootTime === null) {
self::$bootTime = microtime(true);
}
$ageSeconds = microtime(true) - self::$bootTime;
$isCold = $ageSeconds < 30;
$request->attributes->set('container_age_seconds', $ageSeconds);
$request->attributes->set('is_cold_boot', $isCold);
return $next($request);
}
}Push these attributes to your APM so cold-boot requests segment separately. A slow cold path is a bootstrap problem (reduce package size, pre-warm caches); a slow warm path is a code problem.
Log egress
Cloud's built-in log viewer is fine for quick debugging but thin on retention. For long-term log aggregation, add a Monolog remote handler in config/logging.php pointing at Loki, Axiom, or Better Stack. See our log aggregation guide for patterns.
Nightwatch Cloud vs NightOwl on Laravel Cloud
Both work. The choice is about tradeoffs:
- Nightwatch Cloud — same team as Laravel Cloud, designed for zero-config pairing. Usage-based pricing above 300K events/month free tier. Data on the Laravel team's cloud.
- NightOwl — flat from $5/month, data in a PostgreSQL you own. Pairs with Cloud via the agent-as-worker pattern above. Trade zero-config for data residency.
THE EASY WAY
NightOwl as a first-party worker
Add the agent command to your Cloud worker config. Point at your PostgreSQL. Every request, query, job, exception, and scheduled task flows into your database. From $5/month flat regardless of traffic.
composer require nightowl/agent
php artisan nightowl:install