Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure event filtering #41

Open
phptek opened this issue Nov 10, 2019 · 0 comments
Open

Configure event filtering #41

phptek opened this issue Nov 10, 2019 · 0 comments

Comments

@phptek
Copy link
Owner

phptek commented Nov 10, 2019

Sometimes Sentry itself will become flooded with messages caused by the same underlying issue, which for - reasons - can take some time to resolve. Due to the way Sentry itself works, a slight change in the data payload and it thinks a particular error is completely new - even though as humans we can see it's almost exactly the same as any number of previous ones.

Therefore it would be useful to be able to add a one-line change to a file and have the Sentry SDK ignore messages that match these criteria, by hooking into the `before_send' event config option. See here: https://docs.sentry.io/error-reporting/configuration/filtering/?platform=php.

This could be done using YML as per the below, but it would require a commit+push+deployment to achieve. Instead, a suitable fix for this issue could take an uploaded file via a dedicated tab in the admin UI lavelled "Sentry" with an UploadField so that config could simply be uploaded to the F/S. Alternatively, a separate DataObject subclass could perform the same job - although we're moving away from Sentry itself being the sole arbiter of configuration here.

Either way, the config would use a regular expression to match for incoming data against a given field e.g. the "title":

PhpTek\Sentry\Log\SentryLogger:
  filter:
    title: "WARNING: E_WARNING: chdir(): Permission denied (errno 13"

The above config would instruct the module to return null which means the Sentry SDK will ignore the message.

If going with the upload-able config,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant