lib/sentry/rails/railtie.rb in sentry-rails-0.1.2 vs lib/sentry/rails/railtie.rb in sentry-rails-0.2.0
- old
+ new
@@ -8,10 +8,11 @@
module Sentry
class Railtie < ::Rails::Railtie
initializer "sentry.use_rack_middleware" do |app|
app.config.middleware.insert 0, Sentry::Rails::CaptureException
+ app.config.middleware.insert 0, Sentry::Rack::Tracing
end
initializer 'sentry.action_controller' do
ActiveSupport.on_load :action_controller do
include Sentry::Rails::ControllerMethods
@@ -47,9 +48,14 @@
elsif defined?(::ActionDispatch::ShowExceptions)
exceptions_class = ::ActionDispatch::ShowExceptions
end
exceptions_class.send(:prepend, Sentry::Rails::Overrides::DebugExceptionsCatcher)
+ end
+
+ if Sentry.configuration.tracing_enabled?
+ Sentry::Rails::Tracing.subscribe_tracing_events
+ Sentry::Rails::Tracing.patch_active_support_notifications
end
end
initializer 'sentry.active_job' do
ActiveSupport.on_load :active_job do