Sha256: 39edbe7770409c0f168795cad10ab374e5c470bbc17d364b3645000fa073c9ce

Contents?: true

Size: 865 Bytes

Versions: 13

Compression:

Stored size: 865 Bytes

Contents

require "instana/rack"

if defined?(::Rails)
  # In Rails, let's use the Rails logger
  ::Instana.logger = ::Rails.logger if ::Rails.logger

  if ::Rails::VERSION::MAJOR < 3
    ::Rails.configuration.after_initialization do
      ::Instana.logger.warn "Instrumenting Rack"
      ::Rails.configuration.middleware.insert 0, ::Instana::Rack
    end
  else
    module ::Instana
      class Railtie < ::Rails::Railtie
        initializer 'instana.rack' do |app|
          ::Instana.logger.warn "Instrumenting Rack"
          app.config.middleware.insert 0, ::Instana::Rack
        end

        config.after_initialize do
          require "instana/frameworks/instrumentation/active_record"
          require "instana/frameworks/instrumentation/action_controller"
          require "instana/frameworks/instrumentation/action_view"
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
instana-1.4.9 lib/instana/frameworks/rails.rb
instana-1.4.8 lib/instana/frameworks/rails.rb
instana-1.4.7 lib/instana/frameworks/rails.rb
instana-1.4.6 lib/instana/frameworks/rails.rb
instana-1.4.5 lib/instana/frameworks/rails.rb
instana-1.4.4 lib/instana/frameworks/rails.rb
instana-1.4.2 lib/instana/frameworks/rails.rb
instana-1.4.1 lib/instana/frameworks/rails.rb
instana-1.4.0 lib/instana/frameworks/rails.rb
instana-1.3.3 lib/instana/frameworks/rails.rb
instana-1.3.2 lib/instana/frameworks/rails.rb
instana-1.3.1 lib/instana/frameworks/rails.rb
instana-1.3.0 lib/instana/frameworks/rails.rb