lib/ddtrace/contrib/rails/railtie.rb in ddtrace-0.16.1 vs lib/ddtrace/contrib/rails/railtie.rb in ddtrace-0.17.0

- old
+ new

@@ -4,21 +4,14 @@ module Datadog # Railtie class initializes class Railtie < Rails::Railtie # Add the trace middleware to the application stack - initializer 'datadog.add_middleware' do |app| - app.middleware.insert_before(0, Datadog::Contrib::Rack::TraceMiddleware) - # Insert right after Rails exception handling middleware, because if it's before, - # it catches and swallows the error. If it's too far after, custom middleware can find itself - # between, and raise exceptions that don't end up getting tagged on the request properly (e.g lost stack trace.) - app.middleware.insert_after(ActionDispatch::ShowExceptions, Datadog::Contrib::Rails::ExceptionMiddleware) + initializer 'datadog.before_intialize' do |app| + Datadog::Contrib::Rails::Patcher.before_intialize(app) end config.after_initialize do - Datadog::Contrib::Rails::Framework.setup - Datadog::Contrib::Rails::ActionController.instrument - Datadog::Contrib::Rails::ActionView.instrument - Datadog::Contrib::Rails::ActiveSupport.instrument + Datadog::Contrib::Rails::Patcher.after_intialize(self) end end end