Sha256: d2ee1048c1bfe3087aabe8b1ee34d30f55f509b0fdece8dfbb21e1d71670e206

Contents?: true

Size: 958 Bytes

Versions: 35

Compression:

Stored size: 958 Bytes

Contents

# frozen_string_literal: true

require_relative '../active_support/notifications/event'

module Datadog
  module Tracing
    module Contrib
      module ActionView
        # Defines basic behavior for an ActionView event.
        module Event
          def self.included(base)
            base.include(ActiveSupport::Notifications::Event)
            base.extend(ClassMethods)
          end

          # Class methods for ActionView events.
          module ClassMethods
            def configuration
              Datadog.configuration.tracing[:action_view]
            end

            def record_exception(span, payload)
              if payload[:exception_object]
                span.set_error(payload[:exception_object])
              elsif payload[:exception]
                # Fallback for ActiveSupport < 5.0
                span.set_error(payload[:exception])
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
datadog-2.9.0 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.8.0 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.7.1 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.7.0 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.6.0 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.5.0 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.4.0 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.3.0 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.2.0 lib/datadog/tracing/contrib/action_view/event.rb
ddtrace-1.23.3 lib/datadog/tracing/contrib/action_view/event.rb
ddtrace-1.23.2 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.1.0 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.0.0 lib/datadog/tracing/contrib/action_view/event.rb
ddtrace-1.23.1 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.0.0.beta2 lib/datadog/tracing/contrib/action_view/event.rb
ddtrace-1.22.0 lib/datadog/tracing/contrib/action_view/event.rb
datadog-2.0.0.beta1 lib/datadog/tracing/contrib/action_view/event.rb
ddtrace-1.21.1 lib/datadog/tracing/contrib/action_view/event.rb
ddtrace-1.21.0 lib/datadog/tracing/contrib/action_view/event.rb
ddtrace-1.20.0 lib/datadog/tracing/contrib/action_view/event.rb