Module: Datadog::Tracing::Contrib::ActiveModelSerializers::Events::Render

Includes:
Datadog::Tracing::Contrib::ActiveModelSerializers::Event
Defined in:
lib/datadog/tracing/contrib/active_model_serializers/events/render.rb

Overview

Defines instrumentation for render.active_model_serializers event

Constant Summary collapse

EVENT_NAME =
'render.active_model_serializers'.freeze

Class Method Summary collapse

Methods included from Datadog::Tracing::Contrib::ActiveModelSerializers::Event

included

Class Method Details

.event_nameObject



23
24
25
# File 'lib/datadog/tracing/contrib/active_model_serializers/events/render.rb', line 23

def event_name
  self::EVENT_NAME
end

.process(span, _event, _id, payload) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/datadog/tracing/contrib/active_model_serializers/events/render.rb', line 31

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

.span_nameObject



27
28
29
# File 'lib/datadog/tracing/contrib/active_model_serializers/events/render.rb', line 27

def span_name
  Ext::SPAN_RENDER
end

.supported?Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/datadog/tracing/contrib/active_model_serializers/events/render.rb', line 18

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