Start free trial
Start free trial Log in

14-day free trial. No credit card.

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.

  • Guide
  • 3 min read

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. Run the NightOwl agent as a background process on the App cluster and on each worker cluster. Ship logs out to a long-retention aggregator. Watch for cold-boot latency when autoscaling kicks in. Tag requests with the container's age so you can tell cold-boot requests from steady-state ones.

Updated

Laravel Cloud gives you enough monitoring to feel covered, which is the trap. The dashboard shows CPU, logs, queue status, and last-run times, so the gaps that actually bite (is a specific endpoint slow, which query is the N+1, did this exception start after the deploy) never announce themselves. You just don't have the data to answer them. The table below shows where Cloud's built-in monitoring stops and what an APM adds on top.

What Cloud provides

Layer Cloud built-in Still want APM for
Server metricsCPU, memory, diskApplication-layer telemetry
Logs1, 7 or 30 days by plan, basic viewerLong retention, structured search
Queue workersWorker status, failed_jobs UIPer-class duration, attempts and failures
Scheduled tasksLast-run timestampsDuration and status of every run
DatabaseEngine metrics (connections, CPU)Per-query p95, repeated queries per request
ExceptionsAppears in logsGrouping, alerts, issue management

Running NightOwl as a background process

Laravel Cloud has no config file for processes; you add them in the dashboard. The laravel/nightwatch package sends telemetry to an agent on the same instance, so the agent has to run next to every instance that sends it. Add a background process with this command on your App cluster, and again on each worker cluster:

Background process command

Terminal
php artisan nightowl:agent

Set NIGHTOWL_TOKEN and the NIGHTOWL_DB_* variables in the environment, and 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. Config, route and view caches are built into the image at build time, but a new container still starts cold, with an empty opcache and fresh connections. A static property can't tell you a container's age under PHP-FPM, because every request runs with fresh static state, so store the first-seen time in a file:

app/Http/Middleware/TagContainerBoot.php

php
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class TagContainerBoot
{
    public function handle(Request $request, Closure $next)
    {
        $marker = sys_get_temp_dir().'/container-booted-at';

        if (! is_file($marker)) {
            file_put_contents($marker, (string) microtime(true));
        }

        $ageSeconds = microtime(true) - (float) file_get_contents($marker);
        $isCold = $ageSeconds < 30;

        $request->attributes->set('container_age_seconds', $ageSeconds);
        $request->attributes->set('is_cold_boot', $isCold);

        return $next($request);
    }
}

Add these values to your log context (Log::withContext()) or your APM's custom context so cold-boot requests can be segmented separately. A slow cold path is a bootstrap problem (reduce package size and the work your service providers do at boot); 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 production monitoring guide for how logs fit alongside the other signals.

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. Each plan has a monthly event quota; ingestion pauses at the quota unless you opt in to buy extra events. Data on the Laravel team's cloud.
  • NightOwl: flat from $5/month, data in a PostgreSQL you own. Pairs with Cloud via the background-process setup above. Trade zero-config for data residency.

Add the application layer Laravel Cloud doesn't show

Cloud's dashboard stops at logs and server metrics. Run the NightOwl agent as a background process on your App and worker clusters, and every request opens as a timeline of the queries and exceptions it produced. It's from $5 a month flat, whatever your traffic does.

No credit card needed.

Terminal
composer require nightowl/agent
php artisan nightowl:install
php artisan nightowl:agent

Frequently asked questions

Anything else, write to support@usenightowl.com

What is Laravel Cloud?

Laravel Cloud is the Laravel team's managed hosting platform (launched February 2025). Git-push deploys, managed MySQL, Serverless Postgres and Valkey/Redis, 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, including a P95 view, but not a full APM: no query pattern grouping, 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. Add php artisan nightowl:agent as a background process on your App cluster in the Cloud dashboard, and on each worker cluster too. The laravel/nightwatch package sends telemetry to an agent on the same instance (127.0.0.1:2407 by default), so every instance that handles requests or jobs needs one next to it. 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, with a different tradeoff.

Where do logs go on Laravel Cloud?

Cloud provides a built-in log viewer that keeps logs for 1, 7 or 30 days, depending on your plan. 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.

Does Cloud auto-scale affect monitoring?

Yes. Cloud spins up additional app containers based on traffic. Config, route and view caches are built into the image at build time, but a new container still starts with an empty opcache and fresh connections. Monitoring should distinguish cold-boot latency from steady-state; tag requests with the container's age and watch how often new containers start, which tells you whether you need more baseline capacity.

What about database monitoring on Cloud?

Cloud surfaces its own managed database 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.

Related

Flat pricing, whatever your traffic does

Every plan starts with a 14-day free trial. No credit card needed.

Hobby
$5 a month

One app for a side project. Issues and alerts, with a 14-day dashboard window.

Start my 14-day trial
TeamRecommended
$15 a month

Up to 3 apps and 5 people per team. Full history, the MCP server, data clearing and agent health.

Start my 14-day trial
Agency
$69 a month

Unlimited client apps and people, one overview of every app, and apps you can hand over.

Start my 14-day trial