Skip to content

Allow capture_exception to manually bypass configured excluded_exceptions #2006

Closed

Description

Describe the idea

Currently, sentry-ruby filters common controller exceptions out of the box via an array of default excluded_exceptions in the configuration. Most of the time, this does a great job cutting down noisy exceptions caused by common user errors like 404s.

However, there's no way to avoid filtering exceptions, and that means they are ALWAYS dropped, even when they are potentially useful information (specifically ActiveRecord::RecordNotFound, which I know comes from sentry-rails but the implementation for exclusion occurs in sentry-ruby).

Allow users to manually override the filter, perhaps as such:

Sentry.capture_exception(exception, ignore_excluded: true)

Why do you think it's beneficial to most of the users

As far as I can tell, other Sentry SDKS for other languages and frameworks do not implement exclusions as aggressively.

Sometimes, it's possible for the default exclusions to contain useful errors, perhaps in a complicated service where the failure might indicate a problem with application code and not necessarily user error.

# Will throw ActiveRecord::RecordNotFound
# but this indicates a problem with application code NOT user error (404)!
def always_fails
  Thing.find(-1)
rescue StandardError => exception
  Sentry.capture_exception(exception)
end

Possible implementation

#2007

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions