Sha256: 1c8ecbc05a1921dd5bb4d2016a8b606703ec6e46e721d6c51dc75389e9b70f24

Contents?: true

Size: 727 Bytes

Versions: 43

Compression:

Stored size: 727 Bytes

Contents

require 'ddtrace/contrib/active_support/notifications/event'

module Datadog
  module Contrib
    module ActiveRecord
      # Defines basic behaviors for an ActiveRecord event.
      module Event
        def self.included(base)
          base.send(:include, ActiveSupport::Notifications::Event)
          base.send(:extend, ClassMethods)
        end

        # Class methods for ActiveRecord events.
        module ClassMethods
          def span_options
            { service: configuration[:service_name] }
          end

          def tracer
            configuration[:tracer]
          end

          def configuration
            Datadog.configuration[:active_record]
          end
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
ddtrace-0.26.1 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.28.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.27.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.26.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.25.1 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.25.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.24.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.23.3 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.23.2 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.23.1 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.23.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.22.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.21.2 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.21.1 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.21.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.20.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.19.1 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.19.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.18.3 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.18.2 lib/ddtrace/contrib/active_record/event.rb