Merge pull request #1015 from Retrospring/sentry-filtering
Add filtering for events reported to Sentry
This commit is contained in:
commit
452266b77a
|
@ -8,4 +8,20 @@ Sentry.init do |config|
|
||||||
# of transactions for performance monitoring.
|
# of transactions for performance monitoring.
|
||||||
# We recommend adjusting this value in production
|
# We recommend adjusting this value in production
|
||||||
config.traces_sample_rate = 0.25
|
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
|
end
|
||||||
|
|
Loading…
Reference in New Issue