Sha256: 36ac8ba8915e55d020761fda143df5b304e6c1afe54093e7ba70977ba01e9bc0

Contents?: true

Size: 1.2 KB

Versions: 12

Compression:

Stored size: 1.2 KB

Contents

require "instana/frameworks/instrumentation/mysql_adapter"
require "instana/frameworks/instrumentation/abstract_mysql_adapter"
require "instana/frameworks/instrumentation/mysql2_adapter"
require "instana/frameworks/instrumentation/postgresql_adapter"

if defined?(::ActiveRecord) && ::Instana.config[:active_record][:enabled]
  case ActiveRecord::Base.connection.adapter_name.downcase
  when 'mysql'
    ::Instana.logger.warn "Instrumenting ActiveRecord (mysql)"
    ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:include, ::Instana::Instrumentation::MysqlAdapter)
    ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter.send(:include, ::Instana::Instrumentation::AbstractMysqlAdapter)
  when 'mysql2'
    ::Instana.logger.warn "Instrumenting ActiveRecord (mysql2)"
    ActiveRecord::ConnectionAdapters::Mysql2Adapter.send(:include, ::Instana::Instrumentation::Mysql2Adapter)
  when 'postgresql'
    ::Instana.logger.warn "Instrumenting ActiveRecord (postgresql)"
    ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, ::Instana::Instrumentation::PostgreSQLAdapter)
  else
    ::Instana.logger.warn "Unsupported ActiveRecord adapter: #{ActiveRecord::Base.connection.adapter_name.downcase}"
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
instana-1.4.7 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.4.6 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.4.5 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.4.4 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.4.2 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.4.1 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.4.0 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.3.3 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.3.2 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.3.1 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.3.0 lib/instana/frameworks/instrumentation/active_record.rb
instana-1.2.0 lib/instana/frameworks/instrumentation/active_record.rb