Sha256: 3ffc2322db6728e9c05b685a55de01f3f3b6a9a3428d62a7bad3a17156af790e

Contents?: true

Size: 1.13 KB

Versions: 24

Compression:

Stored size: 1.13 KB

Contents

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

24 entries across 24 versions & 1 rubygems

Version Path
ddtrace-1.23.3 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.23.2 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.23.1 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.22.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.21.1 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.21.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.20.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.19.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.18.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.17.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.16.2 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.16.1 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.16.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.15.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.14.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.13.1 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.13.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.12.1 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.12.0 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb
ddtrace-1.11.1 lib/datadog/tracing/contrib/active_model_serializers/events/render.rb