Download the PHP package esign/laravel-sentry-throttling without Composer
On this page you can find all versions of the php package esign/laravel-sentry-throttling. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download esign/laravel-sentry-throttling
More information about esign/laravel-sentry-throttling
Files in esign/laravel-sentry-throttling
Package laravel-sentry-throttling
Short Description Throttle exceptions being sent to Sentry
License MIT
Homepage https://github.com/esign/laravel-sentry-throttling
Informations about the package laravel-sentry-throttling
Throttle exceptions being sent to Sentry
Laravel includes a built-in mechanism for throttling exceptions, but it doesn’t support defining throttling rules for individual reportables. This package adds the ability to throttle exceptions specifically before they are sent to Sentry. It's especially useful if you want to continue logging all exceptions locally while avoiding repeated reports of the same exception being sent to Sentry. While Sentry does offer its own sampling via the sample_rate setting, that approach is percentage-based and less granular than exception-specific throttling.
Installation
You can install the package via composer:
You must configure the before_send option in your config/sentry.php file so that Sentry uses the throttling logic.
Add the following to your Sentry config:
Usage
Implementing throttling
For Laravel 11+ (slim skeleton)
For newer Laravel applications that don't ship with a default exception handler, create a dedicated class that implements the ThrottlesSentryReports interface:
For Laravel 10 and earlier
If your application has a default exception handler (typically App\Exceptions\Handler), you can implement the ThrottlesSentryReports interface directly on it:
Binding the interface
You must bind your implementation of ThrottlesSentryReports in the Laravel container so the package can resolve it. This is typically done in a service provider, such as App\Providers\AppServiceProvider:
For Laravel 11+ (using dedicated class):
For Laravel 10 and earlier (using exception handler):
Testing
License
The MIT License (MIT). Please see License File for more information.