Nightwatch monitoring for Laravel
2 min read
Updated 3 days ago
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.
⚠️ Important: Health check configuration
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
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