Sha256: e3e049af6d8e159ae671e351c5a8d8e92c4a5cbc09a0a1bdd4247919fe2e1f39

Contents?: true

Size: 1.14 KB

Versions: 12

Compression:

Stored size: 1.14 KB

Contents

# typed: false

require_relative '../../../metadata/ext'
require_relative '../ext'
require_relative '../event'

module Datadog
  module Tracing
    module Contrib
      module ActiveModelSerializers
        module Events
          # Defines instrumentation for render.active_model_serializers event
          module Render
            include ActiveModelSerializers::Event

            EVENT_NAME = 'render.active_model_serializers'.freeze

            module_function

            def supported?
              Gem.loaded_specs['active_model_serializers'] \
                && Gem.loaded_specs['active_model_serializers'].version >= Gem::Version.new('0.10')
            end

            def event_name
              self::EVENT_NAME
            end

            def span_name
              Ext::SPAN_RENDER
            end

            def process(span, _event, _id, payload)
              span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_RENDER)

              set_common_tags(span, payload)
            rescue StandardError => e
              Datadog.logger.debug(e.message)
            end
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.8.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.7.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.6.1 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.6.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.5.2 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.5.1 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.5.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.4.2 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.4.1 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.4.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.3.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb