mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 10:09:53 +01:00
Merge pull request #1015 from Retrospring/sentry-filtering
Add filtering for events reported to Sentry
This commit is contained in:
commit
452266b77a
1 changed files with 16 additions and 0 deletions
|
@ -8,4 +8,20 @@ Sentry.init do |config|
|
|||
# of transactions for performance monitoring.
|
||||
# We recommend adjusting this value in production
|
||||
config.traces_sample_rate = 0.25
|
||||
|
||||
exception_fingerprints = {
|
||||
Excon::Error::ServiceUnavailable => 'external-service',
|
||||
Twitter::Error::InternalServerError => 'external-service',
|
||||
}
|
||||
config.before_send = lambda do |event, hint|
|
||||
# These are used for user-facing errors, not when something goes wrong
|
||||
next if hint[:exception].is_a?(Errors::Base)
|
||||
|
||||
exception_class = hint[:exception].class
|
||||
if exception_fingerprints.key?(exception_class)
|
||||
event.fingerprint = [exception_fingerprints[exception_class]]
|
||||
end
|
||||
|
||||
event
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue