Class: ZipkinTracer::TraceContainer

Inherits:
Object
  • Object
show all
Defined in:
lib/zipkin-tracer/trace_container.rb

Overview

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

Class Method Summary collapse

Class Method Details

.cleanup!Object

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



22
23
24
# File 'lib/zipkin-tracer/trace_container.rb', line 22

def cleanup!
  Thread.current[TRACE_STACK] = []
end

.currentObject



13
14
15
# File 'lib/zipkin-tracer/trace_container.rb', line 13

def current
  container.last
end

.tracing_information_set?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/zipkin-tracer/trace_container.rb', line 17

def tracing_information_set?
  !container.empty?
end

.with_trace_id(trace_id, &_block) ⇒ Object



6
7
8
9
10
11
# 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