Route List
View all requests for an application from the Requests panel. Each route is displayed with its method and path (e.g.,GET /users) and shows high-level aggregate statistics over the selected time period:
- Successful requests (2xx status codes)
- Client errors (4xx status codes)
- Server errors (5xx status codes)
- Total requests for the time period
- Average request duration
- P95 request duration
Individual Route
Click on a route to see all requests for that route over the selected time period, including the status code and duration for each request.Individual Request
Click on any request to view the full details page, which shows a timeline breakdown of the request’s lifecycle and all events that occurred within it. Every event in the timeline can be expanded and navigated to for more details. Standard details include the route name, request method, full URL, request headers, response code, IP address, and user information (if authenticated). Exceptions and request payloads are also displayed if they were captured. See the Redaction section below to configure what is captured.Configuration
Add Context
Nightwatch integrates with Laravel Context, enabling you to attach metadata to your requests, jobs, and commands. This is a particularly powerful feature for understanding the behaviors your users experience. For example, you can capture which feature flags were active during a request or include tenant context to help diagnose tenant-specific issues.Examples
Examples
Capture Request Headers
Request headers are captured by default with common sensitive values like cookies and authorization tokens automatically redacted. You can customize and extend the list of redacted headers via theNIGHTWATCH_REDACT_HEADERS environment variable.
NIGHTWATCH_IGNORE_REQUEST_HEADERS environment variable.
Capture Request Payloads
Nightwatch can automatically capture the request payload for a request that resulted in an exceptions. This is exceptionally useful for gaining a deeper understanding of what triggered an exception. Due to the possible sensitive nature of payload data, this setting is disabled by default. However, you can enable it via theNIGHTWATCH_CAPTURE_REQUEST_PAYLOAD environment variable.
_token, password, password_confirmation. You can customize the list of redacted fields via the NIGHTWATCH_REDACT_PAYLOAD_FIELDS environment variable.
Sampling
Global Sampling
You can configure global sampling for HTTP requests using theNIGHTWATCH_REQUEST_SAMPLE_RATE environment variable. When a request is sampled in, Nightwatch captures the full execution context, including related database queries, queued jobs, exceptions, and outbound HTTP calls.
Route-Based Sampling
The NightwatchSample middleware provides individual route or route group sample rates within your Laravel application.
routes/web.php
Unmatched Routes Sampling
You can set sample rates for bot traffic by using theSample middleware with Laravel’s fallback route. We don’t recommend ignoring all unmatched routes. Instead, you should implement a reduced sample rate for bot traffic to help identify and block unwanted requests.
routes/web.php
Package Route Sampling
Many packages provide options to modify the middleware applied to their routes through configuration. For example, Laravel Nova lets you add middleware to its internal routes in yourconfig/nova.php configuration file.
config/nova.php
Dynamic Sampling
You can use dynamic sampling based on request attributes, such as user roles or other conditions:app/Http/Middleware/SampleAdminRequests.php
routes/web.php
Filtering
There are no specific filtering methods for requests. To conditionally exclude requests from collection, you can use the sampling mechanisms described above.Redaction
You can manually redact sensitive information from requests, including request URLs and IP addresses using theNightwatch::redactRequests() function: