[ GUIDE ]

Monitoring a Laravel Cloud deployment

What Laravel Cloud's built-in monitoring covers, what it doesn't, and how to layer an APM without fighting the platform.

QUICK ANSWER

How do I monitor a Laravel Cloud deployment?

Laravel Cloud ships request logs, server metrics, queue status, and scheduled task history via its dashboard — useful defaults but not a full APM. Layer an application-level APM: Nightwatch Cloud is the officially-integrated pairing; NightOwl works via BYOD Postgres. Add the agent as a Cloud worker process. Ship logs out to a long-retention aggregator. Watch for cold-boot latency when autoscaling kicks in — tag requests with container ID so you can distinguish bootstrapping requests from steady-state.

Updated · 2026-04-13

What Cloud provides

Layer Cloud built-in Still want APM for
Server metricsCPU, memory, diskApplication-layer telemetry
LogsLast N hours, basic viewerLong retention, structured search
Queue workersWorker status, failed_jobs UIPer-class trending, p95 per job
Scheduled tasksLast-run timestampsMissed-run detection, duration trends
DatabaseEngine metrics (connections, CPU)Per-query p95, N+1 detection
ExceptionsAppears in logsGrouping, alerts, issue management

Running NightOwl as a Cloud worker

Laravel Cloud supports worker processes via its application configuration:

laravel-cloud.yaml (illustrative)

yaml
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: 2

Point 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

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.

bash
composer require nightowl/agent
php artisan nightowl:install

Frequently asked questions

What is Laravel Cloud?

Laravel Cloud is the Laravel team's managed hosting platform (launched 2024). Git-push deploys, managed Postgres/Redis/Meilisearch, built-in queue workers, and integrated logs. It's positioned between Forge (server management) and Vapor (serverless) — closer to Heroku's model but Laravel-native.

What monitoring does Laravel Cloud include?

Request logs, server metrics (CPU, memory), queue worker status, and scheduled task history via the Cloud dashboard. Useful defaults but not a full APM — no query pattern grouping, no p95 latency trending, no grouped exceptions with alerts. You'll want to add an application-level APM on top for production workloads beyond trivial scale.

Can I run NightOwl on Laravel Cloud?

Yes. The NightOwl agent runs as a Cloud worker process like any other. Add the agent command (php artisan nightowl:agent) to your worker definition in laravel-cloud.yaml. Point the agent at either Cloud's managed Postgres (simple) or a separate PostgreSQL instance (cleaner isolation).

How does Laravel Cloud integrate with Laravel Nightwatch?

Tightly — Nightwatch Cloud is from the same team and is designed as a first-class Cloud integration. If you want the official experience end-to-end (Cloud + Nightwatch), that's the intended pairing. If you want BYOD data residency or flat pricing regardless of traffic, NightOwl pairs with Cloud equally well — different tradeoff.

Where do logs go on Laravel Cloud?

Cloud provides a built-in log viewer with the last N hours of stdout/stderr. For longer retention, structured search, or aggregation across apps, ship logs out — Monolog with a remote handler pointing at Loki / Axiom / Better Stack / your aggregator of choice. Cloud doesn't currently offer a managed log-retention tier.

Does Cloud auto-scale affect monitoring?

Yes. Cloud spins up additional app containers based on traffic. New containers go through a cold-boot period — Laravel bootstrapping, config caching. Monitoring should distinguish cold-boot latency from steady-state; tag requests with the container ID and alert on sustained cold-start rate spikes that suggest you need more baseline capacity.

What about database monitoring on Cloud?

Cloud surfaces its own managed Postgres metrics (connections, CPU, storage). For per-query monitoring (slow queries, patterns, p95 per statement), you need Laravel-app-level instrumentation via the Nightwatch package — Cloud's database panel shows engine metrics, not application query patterns. NightOwl and Nightwatch Cloud both cover the application side.

PRICING

Flat pricing. No event caps. No per-seat fees.

14-day free trial, no credit card. Your PostgreSQL, your data.

HOBBY

$5 /month

1 app · 14 days lookback · all Laravel events

TEAM

$15 /month

Up to 3 connected apps · unlimited environments · all Laravel events

AGENCY

$69 /month

Unlimited apps · unlimited agent instances · same flat rate at any traffic

Related