Class: Labkit::Tracing::Rails::ActionView::RenderTemplateInstrumenter Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

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

#tags(payload) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def tags(payload)
  tags = { "component" => COMPONENT_TAG }
  # OpenTelemetry rejects nil attributes, and error templates may not
  # have a layout (e.g., public/406-unsupported-browser.html).
  tags["template.id"] = payload[:identifier] if payload[:identifier]
  tags["template.layout"] = payload[:layout] if payload[:layout]
  tags
end