Laravel applications rarely fail loudly in production. Instead, they slow down, queues back up, jobs retry silently, and users experience poor performance before developers even notice. Laravel Nightwatch solves this problem by providing first-class production monitoring built specifically for Laravel.
1. What is Laravel Nightwatch?
Laravel Nightwatch is Laravel’s official production monitoring and observability tool. It is designed to track performance, errors, queues, and requests in real time with minimal overhead. Unlike Laravel Telescope, Nightwatch is safe and optimized for production environments.
By combining Amazon Managed Streaming for Apache Kafka (Amazon MSK) with ClickHouse Cloud and AWS Lambda, Laravel Nightwatch delivers high-volume, low-latency monitoring at scale, while maintaining the simplicity and developer experience Laravel is known for.

2. Why Laravel Nightwatch?
Traditional monitoring tools are often framework-agnostic and require complex setup. Nightwatch understands Laravel internals such as controllers, middleware, queues, and jobs.
Key benefits include:
– Real-time request performance tracking
– Queue and job monitoring
– Automatic exception tracking
– Slow database query detection
– Production-safe with sampling
3. Installation and Setup
Install Nightwatch using Composer:
composer require laravel/nightwatch
Publish the configuration file:
php artisan nightwatch:install
Add the following environment variables:
NIGHTWATCH_ENABLED=true
NIGHTWATCH_API_KEY=your_api_key_here

4. Monitoring HTTP Requests
Nightwatch automatically monitors incoming HTTP requests, tracking response time, memory usage, and status codes.
Example: Slow HTTP Endpoint
The following route simulates a slow API endpoint. Nightwatch will automatically flag this request as slow in the dashboard.
Route::get('/reports', function () {
sleep(3);
return response()->json(['status' => 'ok']);
});
5. Queue and Job Monitoring
Queues are a critical part of most Laravel applications. Nightwatch provides deep visibility into job execution time, retries, and failures.
Example: Queue Job
class ProcessOrder implements ShouldQueue
{
public function handle()
{
// Process order logic
sleep(2);
}
}
6. Exception and Error Tracking
Nightwatch captures unhandled exceptions and groups them by type and frequency, making it easy to identify recurring production issues.
Example: Exception Tracking
User::with('orders')->get();
7. Database Query Monitoring
Nightwatch automatically detects slow database queries and common issues such as N+1 query problems.
Example: Inefficient Query
User::with('orders')->get();
8. Best Practices
– Use request sampling to reduce overhead
– Ignore noisy routes like health checks
– Monitor Nightwatch dashboards after every deployment
– Combine Nightwatch insights with application logs

10. Comparing the Observability Stack :
| Feature | Pulse | Telescope | Nightwatch |
| Primary Use | Real-time health | Local debugging | Production Tracing |
| Data Storage | Local MySQL/Redis | Local MySQL | ClickHouse (Managed) |
| Impact on App | Low | High (on large DBs) | Negligible |
| Retention | 7 Days | 24 Hours | 90+ Days |
9. Conclusion
Laravel Nightwatch provides Laravel-native observability with minimal configuration. For production Laravel applications that rely on queues, APIs, and background jobs, Nightwatch is an essential monitoring tool.
