Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/raven/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
require 'English'

module Raven
AVAILABLE_INTEGRATIONS = %w[delayed_job railties sidekiq rack rake].freeze
AVAILABLE_INTEGRATIONS = %w[delayed_job railties sidekiq rack rack-timeout rake].freeze

class << self
extend Forwardable
Expand Down
16 changes: 16 additions & 0 deletions lib/raven/integrations/rack-timeout.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# rubocop:disable Style/FileName
# We need to do this because of the way integration loading works
require 'rack-timeout'

# This integration is a good example of how to change how exceptions
# get grouped by Sentry's UI. Simply override #raven_context in
# the exception class, and append something to the fingerprint
# that will distinguish exceptions in the way you desire.
module RackTimeoutExtensions
def raven_context
{ :fingerprint => ["{{ default }}", env["REQUEST_URI"]] }
end
end

Rack::Timeout::Error.include RackTimeoutExtensions
Rack::Timeout::RequestTimeoutException.include RackTimeoutExtensions
2 changes: 1 addition & 1 deletion spec/raven/raven_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def ivars(object)
it 'injects all integrations except those passed as an argument' do
expect(Raven).to receive(:load_integration).once.with('rake')

Raven.inject_without(:delayed_job, :logger, :railties, :sidekiq, :rack)
Raven.inject_without(:delayed_job, :logger, :railties, :sidekiq, :rack, :"rack-timeout")
end
end

Expand Down