Module: OpenTelemetry::Instrumentation::Sinatra::Extensions::TracerExtension::RenderPatches

Defined in:
lib/opentelemetry/instrumentation/sinatra/extensions/tracer_extension.rb

Overview

Contants patches for render method

Instance Method Summary collapse

Instance Method Details

#render(_engine, data) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/opentelemetry/instrumentation/sinatra/extensions/tracer_extension.rb', line 18

def render(_engine, data, *)
  template_name = data.is_a?(Symbol) ? data : :literal

  Sinatra::Instrumentation.instance.tracer.in_span(
    'sinatra.render_template',
    attributes: { 'sinatra.template_name' => template_name.to_s }
  ) do
    super
  end
end