justbetter/laravel-sentry-filter-events

Lets you filter certain events in Sentry using a filter list

Maintainers

Package info

github.com/justbetter/laravel-sentry-filter-events

pkg:composer/justbetter/laravel-sentry-filter-events

Transparency log

Statistics

Installs: 13

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-06-29 08:22 UTC

This package is auto-updated.

Last update: 2026-07-01 06:34:47 UTC


README

A small package that lets you filter Sentry events with an ignore list. Can also use externally hosted JSON files as lists.

Installation

composer require justbetter/laravel-sentry-filter-events

Configuration

You will have to enable the before_send handler in your config/sentry.php:

'before_send' => [\JustBetter\LaravelSentryFilterEvents\Filters\SentryFilter::class, 'beforeSend'],

You can then configure your config/sentry-filter.php, for example:

// List of errors to ignore
'ignore_errors' => [
    ['message' => 'Unnecessary error'],
    ['exception' => \App\UnnecessaryError::class],
],

You can ignore either messages that contain certain strings, or whole Exception classes.

Global filtering

You can also use an external JSON file to filter errors globally. This has the same format as the list of ignore_errors (but then in JSON). Note that Exception class names need to be complete. For example:

{
    {"message": "Unnecessary error"},
    {"exception": "\\App\\UnnecessaryError"},
},

For simplicity, the config uses the SENTRY_FILTER_LIST_LARAVEL env variable by default to define the filter list url. This means that if you only want to use an external filter list, you don't need to publish the config file.

Scopes

This package contains the ability to use multiple scopes (defined in the config file). This allows you to filter different errors in different situations.

For example, if you have Sentry enabled on your frontend, you don't want to use the same filter list as you would for your backend errors. In that case, you could create a new scope in the config for your frontend errors and retrieve the list like so:

$filterList = resolve(\JustBetter\LaravelSentryFilterEvents\Actions\GetFilterList::class)->get('frontend');

Take a look at how src/filters/SentryFilter.php works for more information.