Control your event consumption with sampling.
1
captures 100%, 0
captures 0%, and values like 0.25
capture 25% of events.
💡 Tip: We recommend starting with the sample rate of 0.1
or lower on requests to build an understanding of your application’s profile and adjusting the rate based on your observations.
NIGHTWATCH_EXCEPTION_SAMPLE_RATE=0
. This setting ensures that exceptions are captured only from sampled requests.
Sample
middleware provides individual route or route group sampling rates within your Laravel application.
Sample
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.
config/nova.php
configuration file.
Nightwatch::sample
method. You can call this method directly for fine-grained control in situations where Nightwatch doesn’t yet provide sampling capabilities.
NIGHTWATCH_EXCEPTION_SAMPLE_RATE
.Nightwatch::rejectCacheEvents()
Nightwatch::rejectMail()
Nightwatch::rejectNotifications()
Nightwatch::rejectOutgoingRequests()
Nightwatch::rejectQueries()
Nightwatch::rejectQueuedJobs()
database
queue or cache driver, you may wish to exclude the underlying queries:
.env
file to true
to disable collection of that event type:
NIGHTWATCH_IGNORE_CACHE_EVENTS
— Exclude all cache eventsNIGHTWATCH_IGNORE_MAIL
— Exclude all mail eventsNIGHTWATCH_IGNORE_NOTIFICATIONS
— Exclude all notification eventsNIGHTWATCH_IGNORE_OUTGOING_REQUESTS
— Exclude all outgoing HTTP requestsNIGHTWATCH_IGNORE_QUERIES
— Exclude all database queries.env
file: