Class: ZipkinTracer::TraceContainer
- Inherits:
-
Object
- Object
- ZipkinTracer::TraceContainer
- 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
-
.cleanup! ⇒ Object
DO NOT USE unless you ABSOLUTELY know what you are doing.
- .current ⇒ Object
- .tracing_information_set? ⇒ Boolean
- .with_trace_id(trace_id, &_block) ⇒ Object
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 |
.current ⇒ Object
13 14 15 |
# File 'lib/zipkin-tracer/trace_container.rb', line 13 def current container.last end |
.tracing_information_set? ⇒ 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 |