class ZipkinTracer::TraceContainer

This class manages a thread-unique container with the stack of traceIds This stack may grow if for instance the current process creates local components inside local components

Constants

TRACE_STACK

Public Class Methods

cleanup!() click to toggle source

DO NOT USE unless you ABSOLUTELY know what you are doing.

# File lib/zipkin-tracer/trace_container.rb, line 22
def cleanup!
  Thread.current[TRACE_STACK] = []
end
current() click to toggle source
# File lib/zipkin-tracer/trace_container.rb, line 13
def current
  container.last
end
tracing_information_set?() click to toggle source
# File lib/zipkin-tracer/trace_container.rb, line 17
def tracing_information_set?
  !container.empty?
end
with_trace_id(trace_id) { || ... } click to toggle source
# File lib/zipkin-tracer/trace_container.rb, line 6
def with_trace_id(trace_id, &_block)
  container.push(trace_id)
  yield
ensure
  container.pop
end

Private Class Methods

container() click to toggle source
# File lib/zipkin-tracer/trace_container.rb, line 28
def container
  Thread.current[TRACE_STACK] ||= []
end