Class: Labkit::Tracing::Rails::ActionView::RenderCollectionInstrumenter

Inherits:
AbstractInstrumenter show all
Defined in:
lib/labkit/tracing/rails/action_view/render_collection_instrumenter.rb

Overview

For more information on the payloads: guides.rubyonrails.org/active_support_instrumentation.html

Instance Method Summary collapse

Methods inherited from AbstractInstrumenter

#finish, #scope_stack, #start

Instance Method Details

#span_name(payload) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/labkit/tracing/rails/action_view/render_collection_instrumenter.rb', line 9

def span_name(payload)
  identifier = ActionView.template_identifier(payload)
  if identifier.nil?
    "render_collection"
  else
    "render_collection:#{identifier}"
  end
end

#tags(payload) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/labkit/tracing/rails/action_view/render_collection_instrumenter.rb', line 18

def tags(payload)
  {
    "component" => COMPONENT_TAG,
    "template.id" => payload[:identifier],
    "template.count" => payload[:count] || 0,
    "template.cache.hits" => payload[:cache_hits] || 0,
  }
end