class BaselineRedRpm::Tracing::ManagedTracer

Attributes

thread_span_stack[R]

Public Class Methods

new(tracer, thread_span_stack = ThreadSpanStack.new) click to toggle source
# File lib/baseline_red_rpm/tracing/managed_tracer.rb, line 11
def initialize(tracer, thread_span_stack = ThreadSpanStack.new)
  @tracer = tracer
  @thread_span_stack = thread_span_stack
end

Public Instance Methods

active_span() click to toggle source
# File lib/baseline_red_rpm/tracing/managed_tracer.rb, line 24
def active_span
  thread_span_stack.active_span
end
collector() click to toggle source
# File lib/baseline_red_rpm/tracing/managed_tracer.rb, line 20
def collector
  @tracer.collector
end
start_span(operation_name, opts = {}, *args) click to toggle source
# File lib/baseline_red_rpm/tracing/managed_tracer.rb, line 28
def start_span(operation_name, opts = {}, *args)
  opts[:child_of] ||= active_span

  span = @tracer.start_span(operation_name, opts, *args)
  @thread_span_stack.set_active_span(span)
end
wrapped() click to toggle source
# File lib/baseline_red_rpm/tracing/managed_tracer.rb, line 16
def wrapped
  @tracer
end