- How do I install Laravel Nightwatch for monitoring my Laravel application?
- Install via Composer with `composer require laravel/nightwatch`, then configure your `.env` file by adding your `NIGHTWATCH_API_KEY`. No additional setup is required for basic monitoring—it auto-instruments Laravel’s core components like requests, queues, and jobs.
- Which Laravel versions does the official Nightwatch package support?
- The package supports Laravel 10 through 13 and PHP 8.1 to 8.5. It’s actively maintained with recent updates in 2026, ensuring compatibility with the latest Laravel releases. Check the [release notes](https://github.com/laravel/nightwatch/releases) for version-specific details.
- Can I customize which requests or commands are monitored by Nightwatch?
- Yes, use `Nightwatch::ignore()` to exclude specific routes, commands, or endpoints from monitoring. You can also adjust sampling rates via environment variables like `NIGHTWATCH_COMMAND_SAMPLE_RATE` to balance granularity and performance overhead.
- Does Laravel Nightwatch work with Laravel Octane or Horizon for async jobs?
- Yes, the package explicitly supports Octane and Horizon workers. By default, it ignores non-critical commands like `octane:status` to reduce noise. For async workers, ensure the agent is properly configured (refer to `AGENTS.md` in the docs).
- How does Nightwatch handle sensitive data like PII in logs or metrics?
- Nightwatch supports automatic redaction of sensitive data starting from version 1.18.0. Configure it via environment variables like `NIGHTWATCH_REDACT_SENSITIVE_DATA=true` or customize redaction rules in your `config/nightwatch.php` file.
- What’s the impact of Nightwatch on application performance, especially with high sampling rates?
- Nightwatch is designed to minimize overhead, but aggressive sampling (e.g., 100% for all requests) can impact performance. Use `NIGHTWATCH_COMMAND_SAMPLE_RATE` to tune sampling—start with a lower rate (e.g., 10–30%) for critical paths and adjust based on monitoring data.
- Can I use Laravel Nightwatch alongside other monitoring tools like Datadog or Sentry?
- Yes, Nightwatch is designed to complement existing tools. Use it for Laravel-specific insights (e.g., queue jobs, Livewire interactions) while relying on other tools for broader infrastructure monitoring. Nightwatch’s alerts can also integrate with third-party systems via webhooks.
- How does Nightwatch handle long-running processes like scheduled tasks or queue jobs?
- Nightwatch buffers metrics locally and transmits them in batches via `Nightwatch::digest()`. For long-running tasks, ensure your `NIGHTWATCH_SCHEDULED_TASK_SAMPLE_RATE` is optimized, and consider using the `digest()` method manually to flush metrics sooner if needed.
- Are there any alternatives to Laravel Nightwatch for Laravel observability?
- Alternatives include open-source tools like Laravel Telescope (for debugging) or commercial APMs like Datadog or New Relic. However, Nightwatch is optimized specifically for Laravel, reducing boilerplate and offering deeper integration with Laravel’s ecosystem (e.g., Livewire, queues, and Octane).
- How do I set up Nightwatch for multi-region Laravel deployments to minimize latency?
- Nightwatch’s agent buffers metrics locally before transmission, reducing latency. For multi-region setups, ensure your Laravel instances are configured to use the nearest Nightwatch API endpoint (via `NIGHTWATCH_API_URL`). Monitor agent-to-SaaS latency in the Nightwatch dashboard and adjust sampling rates if needed.