Nightwatch monitoring for Laravel
Nightwatch monitoring for Laravel
Nightwatch provides lightweight monitoring and observability for your Laravel and Statamic applications. It runs alongside your application container to collect performance metrics, track exceptions, and monitor your application's health.
When using Nightwatch, your application's health check path is included in the monitoring data. Since health checks run frequently (every few seconds), they can create significant noise in your monitoring data. We strongly recommend either:
• Excluding the health check path from Nightwatch monitoring
• Setting a very low sample rate (1-5%) if you need to monitor health checks
The default health check path is
/ for most applications and /up for Statamic applications.
What Nightwatch monitors
Nightwatch automatically tracks various aspects of your Laravel application:
- HTTP requests - Response times, status codes, and request details
- Database queries - Query execution time and frequency
- Queue jobs - Job processing times and failure rates
- Exceptions - Automatic exception capture and reporting
- Performance metrics - Application performance and resource usage
Adding Nightwatch to your application
Nightwatch is available as an additional service for Laravel and Statamic applications.
- Navigate to your application
- Click "Add service"
- Select "Nightwatch" from the monitoring category
- Configure your Nightwatch token (required)
- Adjust optional settings like sample rate
- Click "Create service"
Configuration options
Nightwatch token
Your authentication token for the Nightwatch API. This is required and connects your application to your Nightwatch dashboard.
Sample rate
The percentage of requests to monitor (1-100). Lower values reduce monitoring overhead while still providing insights.
How it works
Nightwatch runs as a sidecar container alongside your main application container. This means:
- It shares the same lifecycle as your application
- It has minimal resource overhead
- It doesn't require a separate service or external connections
- It automatically starts and stops with your application
Frequently asked questions
How do I install Laravel Nightwatch on a hosted application?
Install via Composer with `composer require laravel/nightwatch`, publish the config, then set the `NIGHTWATCH_TOKEN` environment variable in your application settings. Redeploy and metrics start flowing automatically.
What is the NIGHTWATCH_TOKEN environment variable?
NIGHTWATCH_TOKEN is the API key that authenticates your application with the Nightwatch service. Generate it in your Nightwatch dashboard, then add it as a runtime secret in your application settings.
How does Nightwatch differ from Telescope or Pulse?
Telescope is a local debugging tool you run in development. Pulse is a self-hosted application performance dashboard. Nightwatch is a managed external monitoring service with longer data retention and team alerting — closer to a Sentry or Datadog for Laravel-specific signals.
What sample rate should I use in production?
Start with 10% (`NIGHTWATCH_SAMPLE_RATE=0.1`) for high-traffic applications. Health-check requests should be excluded entirely or sampled at 1% to avoid burying real user requests in noise.
How is Nightwatch priced?
Nightwatch pricing is per ingested event volume — see laravel-nightwatch.com for the current tiers. The free tier covers most small to mid-size applications; paid tiers add longer retention and team seats.