laravel/nightwatch
Laravel Nightwatch package for Laravel apps: collects performance and application metrics and securely sends them to the hosted Nightwatch monitoring platform, providing deep Laravel-optimized insights into runtime behavior and overall health.
NIGHTWATCH_COMMAND_SAMPLE_RATE, NIGHTWATCH_SCHEDULED_TASK_SAMPLE_RATE) to balance granularity and performance.// config/nightwatch.php
'sample_rates' => [
'commands' => 0.1, // 10% sampling
'scheduled_tasks' => 0.5, // 50% sampling
],
Nightwatch::digest() for custom processing.octane:status commands) to avoid noise. Test in staging with Octane enabled.Nightwatch::redact() for PII.Nightwatch::ignore().FakeTcpStream for queue simulations).nightwatch:deploy Artisan command and NIGHTWATCH_DEPLOY env var (supports Vapor fallbacks).nightwatch:deploy command with CI/CD pipelines.Nightwatch::ignore() to exclude low-value endpoints (e.g., health checks).| Component | Compatibility | Notes |
|---|---|---|
| Laravel Version | 10.x–13.x | Tested in CI; backport for older versions may require dependency tweaks. |
| PHP Version | 8.1–8.5 | PHP 8.5 support added in v1.20.0. |
| Octane | Supported | Excludes bootstrapping time by default. |
| Queues | Database, Redis, SQS, etc. | Correlates jobs with requests/users. |
| Scheduled Tasks | Laravel Task Scheduling | Sub-minute frequency capture. |
| Third-Party Packages | Low risk (event-based) | May require Nightwatch::ignore() for non-Laravel events. |
NIGHTWATCH_TOKEN).composer require laravel/nightwatch
php artisan vendor:publish --provider="Laravel\Nightwatch\NightwatchServiceProvider"
NIGHTWATCH_TOKEN in .env.config/nightwatch.php (sample rates, ignored routes, redaction rules).nightwatch:deploy with a manual deploy.// config/nightwatch.php
'ignored_routes' => [
'health',
'ping',
],
'redact' => [
'request' => ['password', 'credit_card'],
],
composer why-not laravel/nightwatch to check for version conflicts.NIGHTWATCH_TOKEN is set.Nightwatch errors (e.g., connection issues).Nightwatch::digest() to manually trigger payload transmission.nightwatch:digest queue delays.ignored_routes.How can I help you explore Laravel packages today?