Sha256: 139390cd315cdf1db3320f5d481d33747b919b8321e1abaa673a538331e1b3c2

Contents?: true

Size: 459 Bytes

Versions: 7

Compression:

Stored size: 459 Bytes

Contents

# frozen_string_literal: true

require 'active_record'
require 'opentracing'

require 'active_record/opentracing/version'
require 'active_record/opentracing/processor'

module ActiveRecord
  module OpenTracing
    def self.instrument(tracer: ::OpenTracing.global_tracer)
      processor = Processor.new(tracer)

      ActiveSupport::Notifications.subscribe('sql.active_record') do |*args|
        processor.call(*args)
      end

      self
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
signalfx-activerecord-opentracing-0.1.1 lib/active_record/opentracing.rb
activerecord-opentracing-0.3.1 lib/active_record/opentracing.rb
signalfx-activerecord-opentracing-0.1.0 lib/active_record/opentracing.rb
activerecord-opentracing-0.3.0 lib/active_record/opentracing.rb
activerecord-opentracing-dox-fork-0.2.2.doximity1 lib/active_record/opentracing.rb
activerecord-opentracing-0.2.1 lib/active_record/opentracing.rb
activerecord-opentracing-0.2.0 lib/active_record/opentracing.rb