Sha256: 0cd1109848da35ee5508e374faf79e18a59c82914272352e40b4d28d910ad7d7

Contents?: true

Size: 734 Bytes

Versions: 32

Compression:

Stored size: 734 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

32 entries across 32 versions & 2 rubygems

Version Path
ddtrace-0.49.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.48.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.47.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.46.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.45.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.44.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.43.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.42.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.41.0 lib/ddtrace/contrib/active_record/event.rb
ls-trace-0.2.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.40.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.39.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.38.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.37.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.36.0 lib/ddtrace/contrib/active_record/event.rb
ls-trace-0.1.2 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.35.2 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.35.1 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.35.0 lib/ddtrace/contrib/active_record/event.rb
ddtrace-0.34.2 lib/ddtrace/contrib/active_record/event.rb