class Object
Public Instance Methods
_render_template(template, layout = nil, options = {})
click to toggle source
# File lib/baseline_red_rpm/instruments/action_view.rb, line 110 def _render_template(template, layout = nil, options = {}) if ::BaselineRedRpm::Tracer.tracing? span = BaselineRedRpm.tracer.start_span("render_template") span.set_tag "view.template", template span.set_tag "view.layout", layout span.set_tag "component", "ActionView" span.set_tag "span.kind", "client" BaselineRedRpm::Utils.log_source_and_backtrace(span, :action_view) end _render_template_without_trace(template, layout, options) rescue Exception => e if span span.set_tag('error', true) span.log_error(e) end raise ensure span.finish if span end
Also aliased as: _render_template_without_trace
as_json(*args)
click to toggle source
# File lib/baseline_red_rpm/instruments/active_model_serializer.rb, line 15 def as_json(*args) if ::BaselineRedRpm::Tracer.tracing? span = BaselineRedRpm.tracer.start_span("ActiveModel::Serializer", tags: { "serializer" => self.class.to_s }) BaselineRedRpm::Utils.log_source_and_backtrace(span, :active_model_serializer) end as_json_without_trace(*args) rescue Exception => e if span span.set_tag('error', true) span.log_error(e) end raise ensure span.finish if span end
Also aliased as: as_json_without_trace
render_collection()
click to toggle source
# File lib/baseline_red_rpm/instruments/action_view.rb, line 81 def render_collection if ::BaselineRedRpm::Tracer.tracing? span = BaselineRedRpm.tracer.start_span("render_collection", tags: { "component" => "ActionView", "span.kind" => "client", "view.template" => @path }) if @_request span.set_tag('view.controller', @_request.path_parameters['controller']) span.set_tag('view.action', @_request.path_parameters['action']) end BaselineRedRpm::Utils.log_source_and_backtrace(span, :action_view) end render_collection_without_trace rescue Exception => e if span span.set_tag('error', true) span.log_error(e) end raise ensure span.finish if span end
Also aliased as: render_collection_without_trace, render_collection_without_trace
render_partial(options = {})
click to toggle source
# File lib/baseline_red_rpm/instruments/action_view.rb, line 7 def render_partial(options = {}) if ::BaselineRedRpm::Tracer.tracing? && options.key?(:partial) && options[:partial].is_a?(String) span = BaselineRedRpm.tracer.start_span("render_partial", tags: { "component" => "ActionView", "span.kind" => "client", "view.controller" => @_request.path_parameters['controller'], "view.action" => @_request.path_parameters['action'], "view.template" => options[:partial] }) BaselineRedRpm::Utils.log_source_and_backtrace(span, :action_view) end render_partial_without_trace(options) rescue Exception => e if span span.set_tag('error', true) span.log_error(e) end raise ensure span.finish if span end
Also aliased as: render_partial_without_trace, render_partial_without_trace, render_partial_without_trace
render_partial_collection(options = {})
click to toggle source
# File lib/baseline_red_rpm/instruments/action_view.rb, line 31 def render_partial_collection(options = {}) if ::BaselineRedRpm::Tracer.tracing? span = BaselineRedRpm.tracer.start_span("render_partial_collection", tags: { "component" => "ActionView", "span.kind" => "client", "view.controller" => @_request.path_parameters['controller'], "view.action" => @_request.path_parameters['action'], "view.template" => @path }) BaselineRedRpm::Utils.log_source_and_backtrace(span, :action_view) end render_partial_collection_without_trace(options) rescue Exception => e if span span.set_tag('error', true) span.log_error(e) end raise ensure span.finish if span end
Also aliased as: render_partial_collection_without_trace
render_template(template, layout_name = nil, locals = {})
click to toggle source
# File lib/baseline_red_rpm/instruments/action_view.rb, line 187 def render_template(template, layout_name = nil, locals = {}) if ::BaselineRedRpm::Tracer.tracing? layout = if layout_name if layout_name.is_a?(String) layout_name elsif layout_name.is_a?(Proc) layout_name.call elsif method(:find_layout).arity == 3 find_layout(layout_name, locals, [formats.first]) elsif locals find_layout(layout_name, locals) end end span = BaselineRedRpm.tracer.start_span("render_template") span.set_tag "view.layout", layout ? layout.inspect : "" span.set_tag "view.template", template.inspect span.set_tag "component", "ActionView" span.set_tag "span.kind", "client" BaselineRedRpm::Utils.log_source_and_backtrace(span, :action_view) end render_template_without_trace(template, layout_name, locals) rescue Exception => e if span span.set_tag('error', true) span.log_error(e) end raise ensure span.finish if span end
Also aliased as: render_template_without_trace
request_with_trace(*args, &block)
click to toggle source
# File lib/baseline_red_rpm/instruments/net_http.rb, line 7 def request_with_trace(*args, &block) if ::BaselineRedRpm::Tracer.tracing? span = ::BaselineRedRpm.tracer.start_span("net-http", tags: { "component" => "NetHttp", "span.kind" => "client" }) if args.length && args[0] req = args[0] BaselineRedRpm.tracer.inject(span.context, OpenTracing::FORMAT_RACK, req) span.set_tag "http.protocol", (use_ssl? ? "https" : "http") span.set_tag "http.url", req.path span.set_tag "http.method", req.method span.set_tag "peer.hostname", addr_port BaselineRedRpm::Utils.log_source_and_backtrace(span, :net_http) end response = request_without_trace(*args, &block) span.exit span.set_tag "http.status_code", response.code if (response.code.to_i >= 300 || response.code.to_i <= 308) && response.header["Location"] span.set_tag "http.redirect", response.header["Location"] end span.finish else response = request_without_trace(*args, &block) end response end
Also aliased as: request